| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# This is a rediff(1) testcase. |
| 4 |
# Test: Remove an addition and check the subsequent offsets. |
| 5 |
|
| 6 |
|
| 7 |
. ${top_srcdir-.}/tests/common.sh |
| 8 |
|
| 9 |
cat << EOF > original-patch |
| 10 |
--- file.orig |
| 11 |
+++ file |
| 12 |
@@ -1,6 +1,8 @@ |
| 13 |
blah |
| 14 |
blah |
| 15 |
blah |
| 16 |
+Remove this line! |
| 17 |
+But not this one! |
| 18 |
blah |
| 19 |
blah |
| 20 |
blah |
| 21 |
@@ -100,3 +102,4 @@ |
| 22 |
blah |
| 23 |
blah |
| 24 |
blah |
| 25 |
-End of file |
| 26 |
EOF |
| 27 |
sed -e '/^+R/d' original-patch > edited-patch |
| 28 |
|
| 29 |
${REDIFF} original-patch edited-patch 2>errors >rediffed-patch || exit 1 |
| 30 |
[ -s errors ] && exit 1 |
| 31 |
cat << EOF | cmp - rediffed-patch || exit 1 |
| 32 |
--- file.orig |
| 33 |
+++ file |
| 34 |
@@ -1,6 +1,7 @@ |
| 35 |
blah |
| 36 |
blah |
| 37 |
blah |
| 38 |
+But not this one! |
| 39 |
blah |
| 40 |
blah |
| 41 |
blah |
| 42 |
@@ -100,3 +101,4 @@ |
| 43 |
blah |
| 44 |
blah |
| 45 |
blah |
| 46 |
-End of file |
| 47 |
EOF |