summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--quilt/patches.in2
-rw-r--r--test/timestamps.test46
2 files changed, 47 insertions, 1 deletions
diff --git a/quilt/patches.in b/quilt/patches.in
index 6a245c0..1007ca7 100644
--- a/quilt/patches.in
+++ b/quilt/patches.in
@@ -71,7 +71,7 @@ touched_by_patch()
| awk '
/^(\+\+\+|---)[ \t]/ {
sub(/^(\+\+\+|---)[ \t]/, "")
- sub(/[ \t][^ \t]*$/, "")
+ sub(/\t[^\t]*$/, "")
sub(/^\/dev\/null/, "")
for (i=0; i<'$strip'; i++)
sub(/^[^\/]*\//, "")
diff --git a/test/timestamps.test b/test/timestamps.test
new file mode 100644
index 0000000..f25c0f2
--- /dev/null
+++ b/test/timestamps.test
@@ -0,0 +1,46 @@
+# Test how quilt behaves when patches include timestamps
+
+$ mkdir patches
+
+$ cat > patches/series
+< unified-create.patch
+< unified-update.patch
+< unified-delete.patch
+
+$ cat > patches/unified-create.patch
+< diff -ruN a/file b/file
+< --- a/file 1970-01-01 01:00:00.000000000 +0100
+< +++ b/file 2014-01-15 11:19:43.000000000 +0100
+< @@ -0,0 +1 @@
+< +new line
+
+$ cat > patches/unified-update.patch
+< diff -ruN a/file b/file
+< --- a/file 2014-01-15 11:19:43.000000000 +0100
+< +++ b/file 2014-01-15 11:20:17.000000000 +0100
+< @@ -1 +1 @@
+< -new line
+< +updated line
+
+$ cat > patches/unified-delete.patch
+< diff -ruN a/file b/file
+< --- a/file 2014-01-15 11:20:17.000000000 +0100
+< +++ b/file 1970-01-01 01:00:00.000000000 +0100
+< @@ -1 +0,0 @@
+< -updated line
+
+$ quilt patches file
+> patches/unified-create.patch
+> patches/unified-update.patch
+> patches/unified-delete.patch
+
+$ quilt push -qa
+> Applying patch patches/unified-create.patch
+> Applying patch patches/unified-update.patch
+> Applying patch patches/unified-delete.patch
+> Now at patch patches/unified-delete.patch
+
+$ quilt patches file
+> patches/unified-create.patch
+> patches/unified-update.patch
+> patches/unified-delete.patch