| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# This is a filterdiff(1) testcase. |
| 4 |
# Handle git format-patch output when stripping pathname components |
| 5 |
# From: https://github.com/twaugh/patchutils/issues/12 |
| 6 |
|
| 7 |
. ${top_srcdir-.}/tests/common.sh |
| 8 |
|
| 9 |
cat <<"EOF" > git-output |
| 10 |
diff --git a/test.txt b/test.txt |
| 11 |
index 257cc56..5716ca5 100644 |
| 12 |
--- a/test.txt |
| 13 |
+++ b/test.txt |
| 14 |
@@ -1 +1 @@ |
| 15 |
-foo |
| 16 |
+bar |
| 17 |
EOF |
| 18 |
|
| 19 |
${FILTERDIFF} --strip=1 git-output 2>errors >output || { cat errors; exit 1; } |
| 20 |
[ -s errors ] && { cat errors; exit 1; } |
| 21 |
cmp output <<"EOF" || exit 1 |
| 22 |
diff --git test.txt test.txt |
| 23 |
index 257cc56..5716ca5 100644 |
| 24 |
--- test.txt |
| 25 |
+++ test.txt |
| 26 |
@@ -1 +1 @@ |
| 27 |
-foo |
| 28 |
+bar |
| 29 |
EOF |
| 30 |
exit 0 |