]> git.proxmox.com Git - libgit2.git/blob - src/remote.h
Update upstream source from tag 'upstream/1.3.0+dfsg.1'
[libgit2.git] / src / remote.h
1 /*
2 * Copyright (C) the libgit2 contributors. All rights reserved.
3 *
4 * This file is part of libgit2, distributed under the GNU GPL v2 with
5 * a Linking Exception. For full terms see the included COPYING file.
6 */
7 #ifndef INCLUDE_remote_h__
8 #define INCLUDE_remote_h__
9
10 #include "common.h"
11
12 #include "git2/remote.h"
13 #include "git2/transport.h"
14 #include "git2/sys/transport.h"
15
16 #include "refspec.h"
17 #include "vector.h"
18 #include "net.h"
19
20 #define GIT_REMOTE_ORIGIN "origin"
21
22 struct git_remote {
23 char *name;
24 char *url;
25 char *pushurl;
26 git_vector refs;
27 git_vector refspecs;
28 git_vector active_refspecs;
29 git_vector passive_refspecs;
30 git_transport *transport;
31 git_repository *repo;
32 git_push *push;
33 git_indexer_progress stats;
34 unsigned int need_pack;
35 git_remote_autotag_option_t download_tags;
36 int prune_refs;
37 int passed_refspecs;
38 };
39
40 typedef struct git_remote_connection_opts {
41 const git_strarray *custom_headers;
42 const git_proxy_options *proxy;
43 } git_remote_connection_opts;
44
45 #define GIT_REMOTE_CONNECTION_OPTIONS_INIT { NULL, NULL }
46
47 int git_remote__connect(git_remote *remote, git_direction direction, const git_remote_callbacks *callbacks, const git_remote_connection_opts *conn);
48
49 int git_remote__urlfordirection(git_buf *url_out, struct git_remote *remote, int direction, const git_remote_callbacks *callbacks);
50 int git_remote__http_proxy(char **out, git_remote *remote, git_net_url *url);
51
52 git_refspec *git_remote__matching_refspec(git_remote *remote, const char *refname);
53 git_refspec *git_remote__matching_dst_refspec(git_remote *remote, const char *refname);
54
55 #endif