Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit 9720a5f

Browse files
committed
add test for crashing diff
this reuses an existing patch, setting context to 6 triggers the bug, becuase of a 5-line trailing equals chunk. Signed-off-by: Mechiel Lukkien <[email protected]>
1 parent 007ebc4 commit 9720a5f

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

plumbing/format/diff/unified_encoder_test.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,43 @@ index ab5eed5d4a2c33aeef67e0188ee79bed666bde6f..0adddcde4fd38042c354518351820eb0
475475
V
476476
W
477477
`,
478+
}, {
479+
patch: oneChunkPatch,
480+
desc: "modified deleting lines file with context to 6",
481+
context: 6,
482+
diff: `diff --git a/onechunk.txt b/onechunk.txt
483+
index ab5eed5d4a2c33aeef67e0188ee79bed666bde6f..0adddcde4fd38042c354518351820eb06c417c82 100644
484+
--- a/onechunk.txt
485+
+++ b/onechunk.txt
486+
@@ -1,27 +1,23 @@
487+
-A
488+
B
489+
C
490+
D
491+
E
492+
F
493+
G
494+
-H
495+
I
496+
J
497+
K
498+
L
499+
M
500+
N
501+
502+
O
503+
P
504+
Q
505+
R
506+
S
507+
T
508+
-U
509+
V
510+
W
511+
X
512+
Y
513+
Z
514+
`,
478515
}, {
479516
patch: oneChunkPatch,
480517

0 commit comments

Comments
 (0)