summaryrefslogtreecommitdiff
path: root/refspec.h
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2018-05-16 15:57:48 -0700
committerJunio C Hamano <gitster@pobox.com>2018-05-18 06:19:41 +0900
commitec0cb496553ac82f97205a415ca77618406b30e3 (patch)
tree77a9fc47ed6ea5e08d424faa2776d4c6a9e1e636 /refspec.h
parentccdcbd54c4475c2238b310f7113ab3075b5abc9c (diff)
downloadgit-ec0cb496553ac82f97205a415ca77618406b30e3.tar.gz
refspec: move refspec parsing logic into its own file
In preparation for performing a refactor on refspec related code, move the refspec parsing logic into its own file. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refspec.h')
-rw-r--r--refspec.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/refspec.h b/refspec.h
new file mode 100644
index 0000000000..62625c23a3
--- /dev/null
+++ b/refspec.h
@@ -0,0 +1,23 @@
+#ifndef REFSPEC_H
+#define REFSPEC_H
+
+#define TAG_REFSPEC "refs/tags/*:refs/tags/*"
+extern const struct refspec *tag_refspec;
+
+struct refspec {
+ unsigned force : 1;
+ unsigned pattern : 1;
+ unsigned matching : 1;
+ unsigned exact_sha1 : 1;
+
+ char *src;
+ char *dst;
+};
+
+int valid_fetch_refspec(const char *refspec);
+struct refspec *parse_fetch_refspec(int nr_refspec, const char **refspec);
+struct refspec *parse_push_refspec(int nr_refspec, const char **refspec);
+
+void free_refspec(int nr_refspec, struct refspec *refspec);
+
+#endif /* REFSPEC_H */