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