argv_array_clear(&argv);
return error(_("could not check out original"
" HEAD '%s'. Try 'git bisect"
- "reset <commit>'."), branch.buf);
+ " reset <commit>'."), branch.buf);
}
argv_array_clear(&argv);
}
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;
OPT_BOOL(0, "no-checkout", &no_checkout,
N_("update BISECT_HEAD instead of checking out the current commit")),
OPT_BOOL(0, "no-log", &nolog,
- N_("no log for BISECT_WRITE ")),
+ N_("no log for BISECT_WRITE")),
OPT_END()
};
struct bisect_terms terms = { .term_good = NULL, .term_bad = NULL };