summaryrefslogtreecommitdiff
path: root/quilt/patches/test_broken_patches
blob: c161288b613f8708312893e8b93367bff774a966 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---
 test/file-not-found.test |   30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

Index: b/test/file-not-found.test
===================================================================
--- /dev/null
+++ b/test/file-not-found.test
@@ -0,0 +1,30 @@
+# Try to push a patch touching a file which does not exist in this tree
+
+$ rm -rf d
+$ mkdir -p d/patches
+$ cd d
+
+$ mkdir subdir
+$ echo foo > subdir/file.txt
+$ echo bar > subdir/other.txt
+$ diff -u subdir/file.txt subdir/other.txt > patches/patch
+# simulate --no-timestamp
+$ sed 's|subdir/file.txt.*|subdir/file.txt|' patches/patch > patches/patch2
+$ sed 's|subdir/other.txt.*|subdir/other.txt|' patches/patch2 > patches/patch
+$ rm subdir/other.txt patches/patch2
+$ echo patch > patches/series
+
+$ quilt push
+> Applying patch patches/patch
+> patching file other.txt
+> Hunk #1 FAILED at 1.
+> 1 out of 1 hunk FAILED -- rejects in file other.txt
+> Patch patches/patch does not apply (enforce with -f)
+
+$ quilt push -qf
+> Applying patch patches/patch
+> 1 out of 1 hunk FAILED -- saving rejects to file other.txt.rej
+> Applied patch patches/patch (forced; needs refresh)
+
+$ cd ..
+$ rm -rf d