]> Kevux Git Server - rit/commit
diff --stat: set the width defaults in a helper function
authorDragan Simic <dsimic@manjaro.org>
Sat, 23 Sep 2023 04:01:14 +0000 (06:01 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 29 Sep 2023 22:46:06 +0000 (15:46 -0700)
commit4ca7a3fd26d0c6214f46f2413c5ba8ed346fea1a
tree95465fb5a6b478a683f8dffd9fae8940415680de
parent493f4622739e9b64f24b465b21aa85870dd9dc09
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>
builtin/diff.c
builtin/log.c
builtin/merge.c
builtin/rebase.c
diff.c
diff.h
t/t4052-stat-output.sh