diff options
| author | Patrick Steinhardt <ps@pks.im> | 2024-06-07 08:37:57 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-06-07 10:30:49 -0700 |
| commit | 235ac3f81ad1950f2e6b47b30561eb96844e1c85 (patch) | |
| tree | 134a6940986f9decc562037f209499e890774a10 /refspec.c | |
| parent | 66f892bb075f19bed784b86c7850a89c9a865aca (diff) | |
| download | git-235ac3f81ad1950f2e6b47b30561eb96844e1c85.tar.gz | |
refspec: remove global tag refspec structure
We have a global tag refspec structure that is used by both git-clone(1)
and git-fetch(1). Initialization of the structure will break once we
enable `-Wwrite-strings`, even though the breakage is harmless. While we
could just add casts, the structure isn't really required in the first
place as we can simply initialize the structures at the respective
callsites.
Refactor the code accordingly.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refspec.c')
| -rw-r--r-- | refspec.c | 13 |
1 files changed, 0 insertions, 13 deletions
@@ -7,19 +7,6 @@ #include "refspec.h" #include "strbuf.h" -static struct refspec_item s_tag_refspec = { - .force = 0, - .pattern = 1, - .matching = 0, - .exact_sha1 = 0, - .negative = 0, - .src = "refs/tags/*", - .dst = "refs/tags/*", -}; - -/* See TAG_REFSPEC for the string version */ -const struct refspec_item *tag_refspec = &s_tag_refspec; - /* * Parses the provided refspec 'refspec' and populates the refspec_item 'item'. * Returns 1 if successful and 0 if the refspec is invalid. |
