refspec: move refspec parsing logic into its own file
[git/git.git] / refspec.h
1 #ifndef REFSPEC_H
2 #define REFSPEC_H
3
4 #define TAG_REFSPEC "refs/tags/*:refs/tags/*"
5 extern const struct refspec *tag_refspec;
6
7 struct refspec {
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
17 int valid_fetch_refspec(const char *refspec);
18 struct refspec *parse_fetch_refspec(int nr_refspec, const char **refspec);
19 struct refspec *parse_push_refspec(int nr_refspec, const char **refspec);
20
21 void free_refspec(int nr_refspec, struct refspec *refspec);
22
23 #endif /* REFSPEC_H */