aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing
diff options
context:
space:
mode:
authorMechiel Lukkien <mechiel@ueber.net>2018-02-16 14:44:30 +0100
committerMechiel Lukkien <mechiel@ueber.net>2018-02-16 14:44:30 +0100
commit9720a5ff740a5934915c16d306ceff9e6470889e (patch)
treee07f3bc9133e3992396e951838d6b7fea0233338 /plumbing
parent007ebc477a9cb14704cf628859e9de747c268d5b (diff)
downloadgo-git-9720a5ff740a5934915c16d306ceff9e6470889e.tar.gz
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 <mechiel@ueber.net>
Diffstat (limited to 'plumbing')
-rw-r--r--plumbing/format/diff/unified_encoder_test.go37
1 files changed, 37 insertions, 0 deletions
diff --git a/plumbing/format/diff/unified_encoder_test.go b/plumbing/format/diff/unified_encoder_test.go
index 6e12070..0e419ca 100644
--- a/plumbing/format/diff/unified_encoder_test.go
+++ b/plumbing/format/diff/unified_encoder_test.go
@@ -476,6 +476,43 @@ index ab5eed5d4a2c33aeef67e0188ee79bed666bde6f..0adddcde4fd38042c354518351820eb0
W
`,
}, {
+ patch: oneChunkPatch,
+ desc: "modified deleting lines file with context to 6",
+ context: 6,
+ diff: `diff --git a/onechunk.txt b/onechunk.txt
+index ab5eed5d4a2c33aeef67e0188ee79bed666bde6f..0adddcde4fd38042c354518351820eb06c417c82 100644
+--- a/onechunk.txt
++++ b/onechunk.txt
+@@ -1,27 +1,23 @@
+-A
+ B
+ C
+ D
+ E
+ F
+ G
+-H
+ I
+ J
+ K
+ L
+ M
+ N
+-Ñ
+ O
+ P
+ Q
+ R
+ S
+ T
+-U
+ V
+ W
+ X
+ Y
+ Z
+`,
+}, {
patch: oneChunkPatch,
desc: "modified deleting lines file with context to 3",