diff options
| author | Dragan Simic <dsimic@manjaro.org> | 2023-09-23 06:01:14 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-09-29 15:46:06 -0700 |
| commit | 4ca7a3fd26d0c6214f46f2413c5ba8ed346fea1a (patch) | |
| tree | 95465fb5a6b478a683f8dffd9fae8940415680de /builtin/rebase.c | |
| parent | The thirteenth batch (diff) | |
| download | git-4ca7a3fd26d0c6214f46f2413c5ba8ed346fea1a.tar.gz git-4ca7a3fd26d0c6214f46f2413c5ba8ed346fea1a.zip | |
diff --stat: set the width defaults in a helper function
Extract the commonly used initialization of the --stat-width=<width>,
--stat-name-width=<width> and --stat-graph-with=<width> parameters to their
internal default values into a helper function, to avoid repeating the same
initialization code in a few places.
Add a couple of tests to additionally cover existing configuration options
diff.statNameWidth=<width> and diff.statGraphWidth=<width> when used by
git-merge to generate --stat outputs. This closes the gap that existed
previously in the --stat tests, and reduces the chances for having any
regressions introduced by this commit.
While there, perform a small bunch of minor wording tweaks in the improved
unit test, to improve its test-level consistency a bit.
Signed-off-by: Dragan Simic <dsimic@manjaro.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/rebase.c')
| -rw-r--r-- | builtin/rebase.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/builtin/rebase.c b/builtin/rebase.c index ed15accec9..f990811614 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -1803,9 +1803,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) /* We want color (if set), but no pager */ repo_diff_setup(the_repository, &opts); - opts.stat_width = -1; /* use full terminal width */ - opts.stat_name_width = -1; /* respect statNameWidth config */ - opts.stat_graph_width = -1; /* respect statGraphWidth config */ + init_diffstat_widths(&opts); opts.output_format |= DIFF_FORMAT_SUMMARY | DIFF_FORMAT_DIFFSTAT; opts.detect_rename = DIFF_DETECT_RENAME; |
