summaryrefslogtreecommitdiff
path: root/builtin/bisect--helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/bisect--helper.c')
-rw-r--r--builtin/bisect--helper.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c
index 1718df7f09..2fcc023a3b 100644
--- a/builtin/bisect--helper.c
+++ b/builtin/bisect--helper.c
@@ -474,14 +474,13 @@ static int bisect_start(struct bisect_terms *terms, int no_checkout,
} else if (starts_with(arg, "--") &&
!one_of(arg, "--term-good", "--term-bad", NULL)) {
return error(_("unrecognized option: '%s'"), arg);
- } else {
- char *commit_id = xstrfmt("%s^{commit}", arg);
- if (get_oid(commit_id, &oid) && has_double_dash)
- die(_("'%s' does not appear to be a valid "
- "revision"), arg);
-
+ } else if (!get_oidf(&oid, "%s^{commit}", arg)) {
string_list_append(&revs, oid_to_hex(&oid));
- free(commit_id);
+ } else if (has_double_dash) {
+ die(_("'%s' does not appear to be a valid "
+ "revision"), arg);
+ } else {
+ break;
}
}
pathspec_pos = i;