summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-06-28 12:53:29 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-06-28 12:53:29 -0700
commita9097269036141876c586ddeee561a37b686c8e5 (patch)
tree7f496e3fd3a4c8aca1fe95c0978744e28e860e28 /builtin
parentFirst batch for 2.19 cycle (diff)
parentrefspec: initalize `refspec_item` in `valid_fetch_refspec()` (diff)
downloadtgif-a9097269036141876c586ddeee561a37b686c8e5.tar.xz
Merge branch 'ab/refspec-init-fix'
Make refspec parsing codepath more robust. * ab/refspec-init-fix: refspec: initalize `refspec_item` in `valid_fetch_refspec()` refspec: add back a refspec_item_init() function refspec: s/refspec_item_init/&_or_die/g
Diffstat (limited to 'builtin')
-rw-r--r--builtin/clone.c2
-rw-r--r--builtin/pull.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index 99e73dae85..74a804f2e8 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -1077,7 +1077,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
if (option_required_reference.nr || option_optional_reference.nr)
setup_reference();
- refspec_item_init(&refspec, value.buf, REFSPEC_FETCH);
+ refspec_item_init_or_die(&refspec, value.buf, REFSPEC_FETCH);
strbuf_reset(&value);
diff --git a/builtin/pull.c b/builtin/pull.c
index 49cc3beb4c..fe002a72f8 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -684,7 +684,7 @@ static const char *get_tracking_branch(const char *remote, const char *refspec)
const char *spec_src;
const char *merge_branch;
- refspec_item_init(&spec, refspec, REFSPEC_FETCH);
+ refspec_item_init_or_die(&spec, refspec, REFSPEC_FETCH);
spec_src = spec.src;
if (!*spec_src || !strcmp(spec_src, "HEAD"))
spec_src = "HEAD";