@@ -713,6 +713,7 @@ static int bisect_checkout(const struct object_id *bisect_rev, int no_checkout)
{
char bisect_rev_hex[GIT_MAX_HEXSZ + 1];
+ int res = 0;
memcpy(bisect_rev_hex, oid_to_hex(bisect_rev), the_hash_algo->hexsz + 1);
update_ref(NULL, "BISECT_EXPECTED_REV", bisect_rev, NULL, 0, UPDATE_REFS_DIE_ON_ERR);
@@ -721,14 +722,14 @@ static int bisect_checkout(const struct object_id *bisect_rev, int no_checkout)
update_ref(NULL, "BISECT_HEAD", bisect_rev, NULL, 0,
UPDATE_REFS_DIE_ON_ERR);
} else {
- int res;
res = run_command_v_opt(argv_checkout, RUN_GIT_CMD);
if (res)
- exit(res);
+ return res > 0 ? -res : res;
}
argv_show_branch[1] = bisect_rev_hex;
- return run_command_v_opt(argv_show_branch, RUN_GIT_CMD);
+ res = run_command_v_opt(argv_show_branch, RUN_GIT_CMD);
+ return res > 0 ? -res : res;
}
static struct commit *get_commit_reference(struct repository *r,