Skip to content

Commit 750d0da

Browse files
avargitster
authored andcommitted
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 e0aaa29 ("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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0711883 commit 750d0da

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

remote.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ static struct refspec s_tag_refspec = {
2222
"refs/tags/*"
2323
};
2424

25+
/* See TAG_REFSPEC for the string version */
2526
const struct refspec *tag_refspec = &s_tag_refspec;
2627

2728
struct counted_string {

remote.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,4 +297,6 @@ extern int parseopt_push_cas_option(const struct option *, const char *arg, int
297297
extern int is_empty_cas(const struct push_cas_option *);
298298
void apply_push_cas(struct push_cas_option *, struct remote *, struct ref *);
299299

300+
#define TAG_REFSPEC "refs/tags/*:refs/tags/*"
301+
300302
#endif

0 commit comments

Comments
 (0)