Skip to content

Commit

Permalink
remote: add a macro for "refs/tags/*:refs/tags/*"
Browse files Browse the repository at this point in the history
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 <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
avar authored and gitster committed Feb 9, 2018
1 parent 0711883 commit 750d0da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions remote.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ static struct refspec s_tag_refspec = {
"refs/tags/*" "refs/tags/*"
}; };


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


struct counted_string { struct counted_string {
Expand Down
2 changes: 2 additions & 0 deletions remote.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -297,4 +297,6 @@ extern int parseopt_push_cas_option(const struct option *, const char *arg, int
extern int is_empty_cas(const struct push_cas_option *); extern int is_empty_cas(const struct push_cas_option *);
void apply_push_cas(struct push_cas_option *, struct remote *, struct ref *); void apply_push_cas(struct push_cas_option *, struct remote *, struct ref *);


#define TAG_REFSPEC "refs/tags/*:refs/tags/*"

#endif #endif

0 comments on commit 750d0da

Please sign in to comment.