summaryrefslogtreecommitdiff
path: root/refspec.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2018-05-16 22:57:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-17 21:19:41 (GMT)
commit0ad4a5ff50dbc839ae26aa60c03b55bf416b6000 (patch)
treed57cea89eb1cf8d6d3a063278540a6268d5be479 /refspec.c
parentec0cb496553ac82f97205a415ca77618406b30e3 (diff)
downloadgit-0ad4a5ff50dbc839ae26aa60c03b55bf416b6000.zip
git-0ad4a5ff50dbc839ae26aa60c03b55bf416b6000.tar.gz
git-0ad4a5ff50dbc839ae26aa60c03b55bf416b6000.tar.bz2
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.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/refspec.c b/refspec.c
index 50892f8..22188f0 100644
--- a/refspec.c
+++ b/refspec.c
@@ -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;