summaryrefslogtreecommitdiff
path: root/bisect.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2016-06-16 19:37:20 -0400
committerJunio C Hamano <gitster@pobox.com>2016-06-16 17:21:48 -0700
commit43ec55091553658e4cfb1d927ff2a0fb50a8fdba (patch)
treecebab399638a45acf49909eadd7efa67691f9825 /bisect.c
parent765428699a5381f113d19974720bc91b5bfeaf1d (diff)
downloadgit-43ec55091553658e4cfb1d927ff2a0fb50a8fdba.tar.gz
bisect: always call setup_revisions after init_revisionsjk/bisect-show-tree
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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'bisect.c')
-rw-r--r--bisect.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/bisect.c b/bisect.c
index 8c6d843699..07bf842acf 100644
--- a/bisect.c
+++ b/bisect.c
@@ -886,6 +886,7 @@ static void show_diff_tree(const char *prefix, struct commit *commit)
if (!opt.diffopt.output_format)
opt.diffopt.output_format = DIFF_FORMAT_RAW;
+ setup_revisions(0, NULL, &opt, NULL);
log_tree_commit(&opt, commit);
}