remote: add a macro for "refs/tags/*:refs/tags/*"

Add a macro with the refspec string "refs/tags/*:refs/tags/*". There's been a pre-defined struct version of this since e0aaa29ff3 ("Have a constant extern refspec for "--tags"", 2008-04-17), but nothing that could be passed to e.g. add_fetch_refspec(). This will be used in subsequent commits to avoid hardcoding this string in multiple places. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Feb 9, 2018 at 20:32 UTC 750d0da9cfbc2519f1ef478d50de0ce549c41f05
2 files changed +3
remote.c
+1
@@ -22,6 +22,7 @@ static struct refspec s_tag_refspec = {
22 "refs/tags/*"
23 };
24
25 +/* See TAG_REFSPEC for the string version */
26 const struct refspec *tag_refspec = &s_tag_refspec;
27
28 struct counted_string {
remote.h
+2
@@ -297,4 +297,6 @@ extern int parseopt_push_cas_option(const struct option *, const char *arg, int
297 extern int is_empty_cas(const struct push_cas_option *);
298 void apply_push_cas(struct push_cas_option *, struct remote *, struct ref *);
299
300 +#define TAG_REFSPEC "refs/tags/*:refs/tags/*"
301 +
302 #endif