diff options
author | Brandon Williams <bmwill@google.com> | 2018-05-16 15:57:49 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-05-18 06:19:41 +0900 |
commit | 0ad4a5ff50dbc839ae26aa60c03b55bf416b6000 (patch) | |
tree | d57cea89eb1cf8d6d3a063278540a6268d5be479 /refspec.c | |
parent | refspec: move refspec parsing logic into its own file (diff) | |
download | tgif-0ad4a5ff50dbc839ae26aa60c03b55bf416b6000.tar.xz |
refspec: rename struct refspec to struct refspec_item
In preparation for introducing an abstraction around a collection of
refspecs (much like how a 'struct pathspec' is a collection of 'struct
pathspec_item's) rename the existing 'struct refspec' to 'struct
refspec_item'.
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refspec.c')
-rw-r--r-- | refspec.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -2,7 +2,7 @@ #include "refs.h" #include "refspec.h" -static struct refspec s_tag_refspec = { +static struct refspec_item s_tag_refspec = { 0, 1, 0, @@ -12,12 +12,12 @@ static struct refspec s_tag_refspec = { }; /* See TAG_REFSPEC for the string version */ -const struct refspec *tag_refspec = &s_tag_refspec; +const struct refspec_item *tag_refspec = &s_tag_refspec; -static struct refspec *parse_refspec_internal(int nr_refspec, const char **refspec, int fetch, int verify) +static struct refspec_item *parse_refspec_internal(int nr_refspec, const char **refspec, int fetch, int verify) { int i; - struct refspec *rs = xcalloc(nr_refspec, sizeof(*rs)); + struct refspec_item *rs = xcalloc(nr_refspec, sizeof(*rs)); for (i = 0; i < nr_refspec; i++) { size_t llen; @@ -135,24 +135,24 @@ static struct refspec *parse_refspec_internal(int nr_refspec, const char **refsp int valid_fetch_refspec(const char *fetch_refspec_str) { - struct refspec *refspec; + struct refspec_item *refspec; refspec = parse_refspec_internal(1, &fetch_refspec_str, 1, 1); free_refspec(1, refspec); return !!refspec; } -struct refspec *parse_fetch_refspec(int nr_refspec, const char **refspec) +struct refspec_item *parse_fetch_refspec(int nr_refspec, const char **refspec) { return parse_refspec_internal(nr_refspec, refspec, 1, 0); } -struct refspec *parse_push_refspec(int nr_refspec, const char **refspec) +struct refspec_item *parse_push_refspec(int nr_refspec, const char **refspec) { return parse_refspec_internal(nr_refspec, refspec, 0, 0); } -void free_refspec(int nr_refspec, struct refspec *refspec) +void free_refspec(int nr_refspec, struct refspec_item *refspec) { int i; |