diff options
| author | Junio C Hamano <gitster@pobox.com> | 2019-07-25 14:27:14 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2019-07-25 14:27:14 -0700 |
| commit | 2c30e34e1a50f9d14fce8f97f3639ac0ebccd819 (patch) | |
| tree | 746f6fa7b17b115ec55e9c8cc0280e4e01b291e8 | |
| parent | Merge branch 'es/git-debugger-doc' into maint (diff) | |
| parent | bisect--helper: verify HEAD could be parsed before continuing (diff) | |
| download | git-2c30e34e1a50f9d14fce8f97f3639ac0ebccd819.tar.gz git-2c30e34e1a50f9d14fce8f97f3639ac0ebccd819.zip | |
Merge branch 'js/bisect-helper-check-get-oid-return-value' into maint
Code cleanup.
* js/bisect-helper-check-get-oid-return-value:
bisect--helper: verify HEAD could be parsed before continuing
Diffstat (limited to '')
| -rw-r--r-- | builtin/bisect--helper.c | 5 |
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; |
