Skip to content

Commit 9bf218b

Browse files
committed
Merge branch 'address-coverity-reports'
Coverity pointed out a couple of bugs, and here are fixes for some of them. Signed-off-by: Johannes Schindelin <[email protected]>
2 parents 6932568 + b4c3bc2 commit 9bf218b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

builtin/bisect--helper.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,10 @@ static int bisect_start(struct bisect_terms *terms, int no_checkout,
570570
write_file(git_path_bisect_start(), "%s\n", start_head.buf);
571571

572572
if (no_checkout) {
573-
get_oid(start_head.buf, &oid);
573+
if (get_oid(start_head.buf, &oid) < 0) {
574+
retval = error(_("invalid ref: '%s'"), start_head.buf);
575+
goto finish;
576+
}
574577
if (update_ref(NULL, "BISECT_HEAD", &oid, NULL, 0,
575578
UPDATE_REFS_MSG_ON_ERR)) {
576579
retval = -1;

builtin/rebase.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ static int rebase_config(const char *var, const char *value, void *data)
12081208
if (git_config_bool(var, value))
12091209
opts->flags |= REBASE_DIFFSTAT;
12101210
else
1211-
opts->flags &= !REBASE_DIFFSTAT;
1211+
opts->flags &= ~REBASE_DIFFSTAT;
12121212
return 0;
12131213
}
12141214

0 commit comments

Comments
 (0)