Skip to content

Commit 0918103

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 b92080a + 337a104 commit 0918103

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
@@ -1198,7 +1198,7 @@ static int rebase_config(const char *var, const char *value, void *data)
11981198
if (git_config_bool(var, value))
11991199
opts->flags |= REBASE_DIFFSTAT;
12001200
else
1201-
opts->flags &= !REBASE_DIFFSTAT;
1201+
opts->flags &= ~REBASE_DIFFSTAT;
12021202
return 0;
12031203
}
12041204

0 commit comments

Comments
 (0)