File: remote.h

package info (click to toggle)
python-pygit2 1.18.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,720 kB
  • sloc: ansic: 12,584; python: 9,337; sh: 205; makefile: 26
file content (152 lines) | stat: -rw-r--r-- 5,135 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#define GIT_FETCH_OPTIONS_VERSION ...
#define GIT_PUSH_OPTIONS_VERSION ...
#define GIT_REMOTE_CALLBACKS_VERSION ...

typedef enum {
	GIT_REMOTE_REDIRECT_NONE,
	GIT_REMOTE_REDIRECT_INITIAL,
	GIT_REMOTE_REDIRECT_ALL
} git_remote_redirect_t;

typedef enum git_remote_completion_t {
	GIT_REMOTE_COMPLETION_DOWNLOAD,
	GIT_REMOTE_COMPLETION_INDEXING,
	GIT_REMOTE_COMPLETION_ERROR,
} git_remote_completion_t;

typedef int (*git_push_transfer_progress_cb)(
	unsigned int current,
	unsigned int total,
	size_t bytes,
	void* payload);

typedef struct {
	char *src_refname;
	char *dst_refname;
	git_oid src;
	git_oid dst;
} git_push_update;

typedef int (*git_push_negotiation)(const git_push_update **updates, size_t len, void *payload);
typedef int (*git_push_update_reference_cb)(const char *refname, const char *status, void *data);
typedef int (*git_remote_ready_cb)(git_remote *remote, int direction, void *payload);
typedef int (*git_url_resolve_cb)(git_buf *url_resolved, const char *url, int direction, void *payload);

struct git_remote_callbacks {
	unsigned int version;
	git_transport_message_cb sideband_progress;
	int (*completion)(git_remote_completion_t type, void *data);
	git_credential_acquire_cb credentials;
	git_transport_certificate_check_cb certificate_check;
	git_indexer_progress_cb transfer_progress;
	int (*update_tips)(const char *refname, const git_oid *a, const git_oid *b, void *data);
	git_packbuilder_progress pack_progress;
	git_push_transfer_progress_cb push_transfer_progress;
	git_push_update_reference_cb push_update_reference;
	git_push_negotiation push_negotiation;
	git_transport_cb transport;
	git_remote_ready_cb remote_ready;
	void *payload;
	git_url_resolve_cb resolve_url;
	int (*update_refs)(const char *refname, const git_oid *a, const git_oid *b, git_refspec *spec, void *data);
};

typedef struct {
	unsigned int version;
	unsigned int pb_parallelism;
	git_remote_callbacks callbacks;
	git_proxy_options proxy_opts;
	git_remote_redirect_t follow_redirects;
	git_strarray custom_headers;
	git_strarray remote_push_options;
} git_push_options;

int git_push_options_init(
	git_push_options *opts,
	unsigned int version);

typedef enum {
	GIT_FETCH_PRUNE_UNSPECIFIED,
	GIT_FETCH_PRUNE,
	GIT_FETCH_NO_PRUNE,
} git_fetch_prune_t;

typedef enum {
	GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED = 0,
	GIT_REMOTE_DOWNLOAD_TAGS_AUTO,
	GIT_REMOTE_DOWNLOAD_TAGS_NONE,
	GIT_REMOTE_DOWNLOAD_TAGS_ALL,
} git_remote_autotag_option_t;

typedef struct {
	int version;
	git_remote_callbacks callbacks;
	git_fetch_prune_t prune;
	unsigned int update_fetchhead;
	git_remote_autotag_option_t download_tags;
	git_proxy_options proxy_opts;
	int depth;
	git_remote_redirect_t follow_redirects;
	git_strarray custom_headers;
} git_fetch_options;

int git_fetch_options_init(
	git_fetch_options *opts,
	unsigned int version);

int git_remote_list(git_strarray *out, git_repository *repo);
int git_remote_lookup(git_remote **out, git_repository *repo, const char *name);
int git_remote_create(
		git_remote **out,
		git_repository *repo,
		const char *name,
		const char *url);
int git_remote_create_with_fetchspec(
		git_remote **out,
		git_repository *repo,
		const char *name,
		const char *url,
		const char *fetch);
int git_remote_create_anonymous(
        git_remote **out,
        git_repository *repo,
        const char *url);
int git_remote_delete(git_repository *repo, const char *name);
const char * git_remote_name(const git_remote *remote);
int git_remote_rename(
	git_strarray *problems,
	git_repository *repo,
	const char *name,
	const char *new_name);
const char * git_remote_url(const git_remote *remote);
int git_remote_set_url(git_repository *repo, const char *remote, const char* url);
const char * git_remote_pushurl(const git_remote *remote);
int git_remote_set_pushurl(git_repository *repo, const char *remote, const char* url);
int git_remote_fetch(
		git_remote *remote,
		const git_strarray *refspecs,
		const git_fetch_options *opts,
		const char *reflog_message);
int git_remote_prune(git_remote *remote, const git_remote_callbacks *callbacks);
int git_remote_push(git_remote *remote,
				const git_strarray *refspecs,
				const git_push_options *opts);
const git_indexer_progress * git_remote_stats(git_remote *remote);
int git_remote_add_push(git_repository *repo, const char *remote, const char *refspec);
int git_remote_add_fetch(git_repository *repo, const char *remote, const char *refspec);
int git_remote_init_callbacks(
	git_remote_callbacks *opts,
	unsigned int version);
size_t git_remote_refspec_count(const git_remote *remote);
const git_refspec * git_remote_get_refspec(const git_remote *remote, size_t n);
int git_remote_get_fetch_refspecs(git_strarray *array, const git_remote *remote);
int git_remote_get_push_refspecs(git_strarray *array, const git_remote *remote);
void git_remote_free(git_remote *remote);

int git_remote_connect(
    git_remote *remote,
    int direction,
    const git_remote_callbacks *callbacks,
    const git_proxy_options *proxy_opts,
    const git_strarray *custom_headers);
int git_remote_ls(const git_remote_head ***out, size_t *size, git_remote *remote);