[PATCH] tests: test show --word-diff --color-moved

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



a18d66cefb ("diff.c: free "buf" in diff_words_flush()", 2022-03-04)
introduced a breakage to `show --word-diff --color-moved` which gives

free(): double free detected in tcache 2
Aborted (core dumped)

on every incarnation. This was not caught by the test suite because we
test `diff --word-diff --color-moved` only so far.

Therefore, add a test for `show`, too.

Reverting a18d66cefb makes the test pass, but there might be a better
fix.

Signed-off-by: Michael J Gruber <git@xxxxxxxxx>
---
 t/t4015-diff-whitespace.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index 9babf13bc9..ff8a0426ca 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -1622,7 +1622,7 @@ test_expect_success 'cmd option assumes configured colored-moved' '
 	test_cmp expected actual
 '
 
-test_expect_success 'no effect from --color-moved with --word-diff' '
+test_expect_success 'no effect on diff from --color-moved with --word-diff' '
 	cat <<-\EOF >text.txt &&
 	Lorem Ipsum is simply dummy text of the printing and typesetting industry.
 	EOF
@@ -1636,6 +1636,12 @@ test_expect_success 'no effect from --color-moved with --word-diff' '
 	test_cmp expect actual
 '
 
+test_expect_failure 'no effect on show from --color-moved with --word-diff' '
+	git show --color-moved --word-diff >actual &&
+	git show --word-diff >expect &&
+	test_cmp expect actual
+'
+
 test_expect_success 'set up whitespace tests' '
 	git reset --hard &&
 	# Note that these lines have no leading or trailing whitespace.
-- 
2.35.1.981.gd72fe90d09




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux