diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c index dda6f0b7cd5934..910cff1cf8a1d2 100644 --- a/builtin/bisect--helper.c +++ b/builtin/bisect--helper.c @@ -571,7 +571,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; diff --git a/builtin/rebase.c b/builtin/rebase.c index 8c2cbc72f6750e..cf45579952e448 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -1210,7 +1210,7 @@ static int rebase_config(const char *var, const char *value, void *data) if (git_config_bool(var, value)) opts->flags |= REBASE_DIFFSTAT; else - opts->flags &= !REBASE_DIFFSTAT; + opts->flags &= ~REBASE_DIFFSTAT; return 0; }