Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Grayson <pete@jpgrayson.net>2022-12-14 20:41:51 +0300
committerJunio C Hamano <gitster@pobox.com>2022-12-15 03:12:04 +0300
commit209d9cb0114dff72e96d58bb3c27409660f1b45c (patch)
tree3485c675b867aa08c6841f58200570fc1c931871 /t/t4046-diff-unmerged.sh
parent12fc4ad89e23af642a8614371ff80bc67cb3315d (diff)
diff: fix regression with --stat and unmerged file
A regression was introduced in 12fc4ad89e (diff.c: use utf8_strwidth() to count display width, 2022-09-14) that causes missing newlines after "Unmerged" entries in `git diff --cached --stat` output. This problem affects v2.39.0-rc0 through v2.39.0. Add the missing newline along with a new test to cover this behavior. Signed-off-by: Peter Grayson <pete@jpgrayson.net> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4046-diff-unmerged.sh')
-rwxr-xr-xt/t4046-diff-unmerged.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t4046-diff-unmerged.sh b/t/t4046-diff-unmerged.sh
index 0ae0cd3a52..ffaf69335f 100755
--- a/t/t4046-diff-unmerged.sh
+++ b/t/t4046-diff-unmerged.sh
@@ -86,4 +86,14 @@ test_expect_success 'diff-files -3' '
test_cmp diff-files-3.expect diff-files-3.actual
'
+test_expect_success 'diff --stat' '
+ for path in $paths
+ do
+ echo " $path | Unmerged" || return 1
+ done >diff-stat.expect &&
+ echo " 0 files changed" >>diff-stat.expect &&
+ git diff --cached --stat >diff-stat.actual &&
+ test_cmp diff-stat.expect diff-stat.actual
+'
+
test_done