Merge branch 'jt/fetch-nego-tip' into ab/fetch-nego
[alt-git.git] / refspec.h
blob3a9363887c48dbba612ae4de195c30f9d382c00c
1 #ifndef REFSPEC_H
2 #define REFSPEC_H
4 #define TAG_REFSPEC "refs/tags/*:refs/tags/*"
5 extern const struct refspec_item *tag_refspec;
7 struct refspec_item {
8 unsigned force : 1;
9 unsigned pattern : 1;
10 unsigned matching : 1;
11 unsigned exact_sha1 : 1;
13 char *src;
14 char *dst;
17 #define REFSPEC_FETCH 1
18 #define REFSPEC_PUSH 0
20 #define REFSPEC_INIT_FETCH { .fetch = REFSPEC_FETCH }
21 #define REFSPEC_INIT_PUSH { .fetch = REFSPEC_PUSH }
23 struct refspec {
24 struct refspec_item *items;
25 int alloc;
26 int nr;
28 const char **raw;
29 int raw_alloc;
30 int raw_nr;
32 int fetch;
35 void refspec_item_init(struct refspec_item *item, const char *refspec, int fetch);
36 void refspec_item_clear(struct refspec_item *item);
37 void refspec_init(struct refspec *rs, int fetch);
38 void refspec_append(struct refspec *rs, const char *refspec);
39 void refspec_appendn(struct refspec *rs, const char **refspecs, int nr);
40 void refspec_clear(struct refspec *rs);
42 int valid_fetch_refspec(const char *refspec);
44 struct argv_array;
46 * Determine what <prefix> values to pass to the peer in ref-prefix lines
47 * (see Documentation/technical/protocol-v2.txt).
49 void refspec_ref_prefixes(const struct refspec *rs,
50 struct argv_array *ref_prefixes);
52 #endif /* REFSPEC_H */