]> git.ipfire.org Git - thirdparty/git.git/blame - refspec.h
refspec: factor out parsing a single refspec
[thirdparty/git.git] / refspec.h
CommitLineData
ec0cb496
BW
1#ifndef REFSPEC_H
2#define REFSPEC_H
3
4#define TAG_REFSPEC "refs/tags/*:refs/tags/*"
0ad4a5ff 5extern const struct refspec_item *tag_refspec;
ec0cb496 6
0ad4a5ff 7struct refspec_item {
ec0cb496
BW
8 unsigned force : 1;
9 unsigned pattern : 1;
10 unsigned matching : 1;
11 unsigned exact_sha1 : 1;
12
13 char *src;
14 char *dst;
15};
16
17int valid_fetch_refspec(const char *refspec);
0ad4a5ff
BW
18struct refspec_item *parse_fetch_refspec(int nr_refspec, const char **refspec);
19struct refspec_item *parse_push_refspec(int nr_refspec, const char **refspec);
ec0cb496 20
0ad4a5ff 21void free_refspec(int nr_refspec, struct refspec_item *refspec);
ec0cb496
BW
22
23#endif /* REFSPEC_H */