Skip to content

Commit a5229cc

Browse files
dschogitster
authored andcommitted
diff: demonstrate a bug with --patience and --ignore-space-at-eol
When a single character is added to a line, the combination of these two options results in an empty diff. This bug was noticed and reported by Naja Melan. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7654286 commit a5229cc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

t/t4033-diff-patience.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ test_description='patience diff algorithm'
55
. ./test-lib.sh
66
. "$TEST_DIRECTORY"/lib-diff-alternative.sh
77

8+
test_expect_failure '--ignore-space-at-eol with a single appended character' '
9+
printf "a\nb\nc\n" >pre &&
10+
printf "a\nbX\nc\n" >post &&
11+
test_must_fail git diff --no-index \
12+
--patience --ignore-space-at-eol pre post >diff &&
13+
grep "^+.*X" diff
14+
'
15+
816
test_diff_frobnitz "patience"
917

1018
test_diff_unique "patience"

0 commit comments

Comments
 (0)