]>
Commit | Line | Data |
---|---|---|
5751f490 DB |
1 | #ifndef REMOTE_H |
2 | #define REMOTE_H | |
3 | ||
4 | struct remote { | |
5 | const char *name; | |
6 | ||
7 | const char **uri; | |
8 | int uri_nr; | |
9 | ||
10 | const char **push_refspec; | |
6b62816c | 11 | struct refspec *push; |
5751f490 DB |
12 | int push_refspec_nr; |
13 | ||
5d46c9d4 DB |
14 | const char **fetch_refspec; |
15 | struct refspec *fetch; | |
16 | int fetch_refspec_nr; | |
17 | ||
5751f490 DB |
18 | const char *receivepack; |
19 | }; | |
20 | ||
21 | struct remote *remote_get(const char *name); | |
22 | ||
b42f6927 JS |
23 | typedef int each_remote_fn(struct remote *remote, void *priv); |
24 | int for_each_remote(each_remote_fn fn, void *priv); | |
25 | ||
5d46c9d4 DB |
26 | int remote_has_uri(struct remote *remote, const char *uri); |
27 | ||
6b62816c DB |
28 | struct refspec { |
29 | unsigned force : 1; | |
30 | unsigned pattern : 1; | |
31 | ||
b42f6927 | 32 | char *src; |
6b62816c DB |
33 | char *dst; |
34 | }; | |
35 | ||
dfd255dd DB |
36 | struct ref *alloc_ref(unsigned namelen); |
37 | ||
38 | /* | |
39 | * Frees the entire list and peers of elements. | |
40 | */ | |
41 | void free_refs(struct ref *ref); | |
42 | ||
6b62816c DB |
43 | int match_refs(struct ref *src, struct ref *dst, struct ref ***dst_tail, |
44 | int nr_refspec, char **refspec, int all); | |
45 | ||
5d46c9d4 DB |
46 | /* |
47 | * For the given remote, reads the refspec's src and sets the other fields. | |
48 | */ | |
49 | int remote_find_tracking(struct remote *remote, struct refspec *refspec); | |
50 | ||
5751f490 | 51 | #endif |