diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2010-02-21 00:37:01 +0100 |
---|---|---|
committer | Andreas Gruenbacher <agruen@suse.de> | 2010-02-21 00:37:40 +0100 |
commit | d300ec9bb83c6bba6f957bf1a051879cb793e199 (patch) | |
tree | 387dfd475f91a7a31bda3ebf6118f770f98b0f77 /tests | |
parent | 70c5b3126f8320cbc7d7d9a565693fff33e70ac0 (diff) | |
download | patch-d300ec9bb83c6bba6f957bf1a051879cb793e199.tar.gz |
Merge: detect already-applied inserts at the end of files
* src/merge.c: When a hunk has fewer suffix than prefix context lines,
try matching to the end of the file instead of doing a "greedy match":
this allows to detect already-applied inserts at the end of the file.
* tests/merge: Add test cases for this.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/merge | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/merge b/tests/merge index 0a3c7ff..98c5705 100644 --- a/tests/merge +++ b/tests/merge @@ -166,6 +166,36 @@ a 4 EOF +check 'x 2 1ia 1ib -- 1ia 1ib' <<EOF +Hunk #1 already applied at 1-2. +a +b +1 +2 + +Hunk #1 already applied at 1-2. +a +b +1 +2 + +EOF + +check 'x 2 2aa 2ab -- 2aa 2ab' <<EOF +Hunk #1 already applied at 3-4. +1 +2 +a +b + +Hunk #1 already applied at 3-4. +1 +2 +a +b + +EOF + # ============================================================== check 'x 4 2d -- 3d' <<EOF |