summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2019-06-17 10:15:16 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-06-17 10:15:16 -0700
commit5b476dc2f13324852d0dbf7f2e5c020d1064ac8c (patch)
tree2e043463dc9681f88bab250f4b472116eb5ed9c2 /builtin
parentMerge branch 'jk/am-i-resolved-fix' (diff)
parentbisect--helper: verify HEAD could be parsed before continuing (diff)
downloadtgif-5b476dc2f13324852d0dbf7f2e5c020d1064ac8c.tar.xz
Merge branch 'js/bisect-helper-check-get-oid-return-value'
Code cleanup. * js/bisect-helper-check-get-oid-return-value: bisect--helper: verify HEAD could be parsed before continuing
Diffstat (limited to 'builtin')
-rw-r--r--builtin/bisect--helper.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c
index e7325fe37f..1fbe156e67 100644
--- a/builtin/bisect--helper.c
+++ b/builtin/bisect--helper.c
@@ -570,7 +570,10 @@ static int bisect_start(struct bisect_terms *terms, int no_checkout,
write_file(git_path_bisect_start(), "%s\n", start_head.buf);
if (no_checkout) {
- get_oid(start_head.buf, &oid);
+ if (get_oid(start_head.buf, &oid) < 0) {
+ retval = error(_("invalid ref: '%s'"), start_head.buf);
+ goto finish;
+ }
if (update_ref(NULL, "BISECT_HEAD", &oid, NULL, 0,
UPDATE_REFS_MSG_ON_ERR)) {
retval = -1;