Skip to content

Commit f866bf0

Browse files
committed
Merge pull request #2184 from dscho/address-coverity-report
Fix some issues reported by Coverity
2 parents ba637d3 + d0033a2 commit f866bf0

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

builtin/bisect--helper.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,10 @@ static int bisect_start(struct bisect_terms *terms, int no_checkout,
571571
write_file(git_path_bisect_start(), "%s\n", start_head.buf);
572572

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

builtin/rebase.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,7 @@ static int rebase_config(const char *var, const char *value, void *data)
12101210
if (git_config_bool(var, value))
12111211
opts->flags |= REBASE_DIFFSTAT;
12121212
else
1213-
opts->flags &= !REBASE_DIFFSTAT;
1213+
opts->flags &= ~REBASE_DIFFSTAT;
12141214
return 0;
12151215
}
12161216

0 commit comments

Comments
 (0)