| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# This is a rediff(1) testcase. |
| 4 |
# Test: Add a hunk at the end of a patch but before another. |
| 5 |
|
| 6 |
|
| 7 |
. ${top_srcdir-.}/tests/common.sh |
| 8 |
|
| 9 |
cat << EOF > original-patch |
| 10 |
--- file.orig |
| 11 |
+++ file |
| 12 |
@@ -6,7 +6,7 @@ |
| 13 |
blah |
| 14 |
blah |
| 15 |
blah |
| 16 |
-not |
| 17 |
+important |
| 18 |
blah |
| 19 |
blah |
| 20 |
blah |
| 21 |
--- otherfile.orig |
| 22 |
+++ otherfile |
| 23 |
@@ -1 +1 @@ |
| 24 |
-a |
| 25 |
+A |
| 26 |
EOF |
| 27 |
|
| 28 |
cat << EOF > edited-patch |
| 29 |
--- file.orig |
| 30 |
+++ file |
| 31 |
@@ -6,7 +6,7 @@ |
| 32 |
blah |
| 33 |
blah |
| 34 |
blah |
| 35 |
-not |
| 36 |
+important |
| 37 |
blah |
| 38 |
blah |
| 39 |
blah |
| 40 |
@@ -36 +36 @@ |
| 41 |
-old |
| 42 |
+new |
| 43 |
--- otherfile.orig |
| 44 |
+++ otherfile |
| 45 |
@@ -1 +1 @@ |
| 46 |
-a |
| 47 |
+A |
| 48 |
EOF |
| 49 |
|
| 50 |
${REDIFF} original-patch edited-patch 2>errors >rediffed-patch || exit 1 |
| 51 |
[ -s errors ] && exit 1 |
| 52 |
cat << EOF | cmp - rediffed-patch || exit 1 |
| 53 |
--- file.orig |
| 54 |
+++ file |
| 55 |
@@ -6,7 +6,7 @@ |
| 56 |
blah |
| 57 |
blah |
| 58 |
blah |
| 59 |
-not |
| 60 |
+important |
| 61 |
blah |
| 62 |
blah |
| 63 |
blah |
| 64 |
@@ -36 +36 @@ |
| 65 |
-old |
| 66 |
+new |
| 67 |
--- otherfile.orig |
| 68 |
+++ otherfile |
| 69 |
@@ -1 +1 @@ |
| 70 |
-a |
| 71 |
+A |
| 72 |
EOF |