summaryrefslogtreecommitdiff
path: root/refspec.c
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2018-06-05 19:54:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-06-11 17:11:29 (GMT)
commitdc0642218306190a2d284f47f75d71aeeaa34d02 (patch)
tree451dfbc97aa5805f5287fd5b06caf82f700b7036 /refspec.c
parent6c301adb0a43bceef65e78df6936bd03a4d1933b (diff)
downloadgit-dc0642218306190a2d284f47f75d71aeeaa34d02.zip
git-dc0642218306190a2d284f47f75d71aeeaa34d02.tar.gz
git-dc0642218306190a2d284f47f75d71aeeaa34d02.tar.bz2
refspec: s/refspec_item_init/&_or_die/g
Rename the refspec_item_init() function introduced in 6d4c057859 ("refspec: introduce struct refspec", 2018-05-16) to refspec_item_init_or_die(). This follows the convention of other *_or_die() functions, and is done in preparation for making it a wrapper for a non-fatal variant. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refspec.c')
-rw-r--r--refspec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/refspec.c b/refspec.c
index ada7854..54b6fe0 100644
--- a/refspec.c
+++ b/refspec.c
@@ -122,7 +122,8 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet
return 1;
}
-void refspec_item_init(struct refspec_item *item, const char *refspec, int fetch)
+void refspec_item_init_or_die(struct refspec_item *item, const char *refspec,
+ int fetch)
{
memset(item, 0, sizeof(*item));
@@ -150,7 +151,7 @@ void refspec_append(struct refspec *rs, const char *refspec)
{
struct refspec_item item;
- refspec_item_init(&item, refspec, rs->fetch);
+ refspec_item_init_or_die(&item, refspec, rs->fetch);
ALLOC_GROW(rs->items, rs->nr + 1, rs->alloc);
rs->items[rs->nr++] = item;