Skip to content

Commit 43ec550

Browse files
peffgitster
authored andcommitted
bisect: always call setup_revisions after init_revisions
init_revisions() initializes the rev_info struct to default values, and setup_revisions() parses any command-line arguments and finalizes the struct. In e22278c (bisect: display first bad commit without forking a new process, 2009-05-28), a show_diff_tree() was added that calls the former but not the latter. It doesn't have any arguments to parse, but it still should do the finalizing step. This may have caused other minor bugs over the years, but it became much more prominent after fe37a9c (pretty: allow tweaking tabwidth in --expand-tabs, 2016-03-29). That leaves the expected tab width as "-1", rather than the true default of "8". When we see a commit with tabs to be expanded, we end up trying to add (size_t)-1 spaces to a strbuf, which complains about the integer overflow. The fix is easy: just call setup_revisions() with no arguments. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7654286 commit 43ec550

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

bisect.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,7 @@ static void show_diff_tree(const char *prefix, struct commit *commit)
886886
if (!opt.diffopt.output_format)
887887
opt.diffopt.output_format = DIFF_FORMAT_RAW;
888888

889+
setup_revisions(0, NULL, &opt, NULL);
889890
log_tree_commit(&opt, commit);
890891
}
891892

0 commit comments

Comments
 (0)