summaryrefslogtreecommitdiffstats
path: root/test/nolink.test
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2007-04-16 04:15:12 +0000
committerAndreas Gruenbacher <agruen@suse.de>2007-04-16 04:15:12 +0000
commit005fb7e539503be9ee56165436d6ec2ec0ec573c (patch)
tree83c7eafbe6e2a1f8edf7e0a7dd4c9b4f3e364c21 /test/nolink.test
parent250a8b619749f3fccae25a36993c8b791fe93c74 (diff)
downloadquilt-005fb7e539503be9ee56165436d6ec2ec0ec573c.tar.gz
- lib/backup-files.c: Do not modify the original file whenever
possible: previously, a ``quilt add'' usually linked the file to he backup and then copied the backup over the file to ensure a link count of one. Recognize this case, and create a copy in the first place instead.
Diffstat (limited to 'test/nolink.test')
-rw-r--r--test/nolink.test57
1 files changed, 57 insertions, 0 deletions
diff --git a/test/nolink.test b/test/nolink.test
new file mode 100644
index 0000000..d29b7c6
--- /dev/null
+++ b/test/nolink.test
@@ -0,0 +1,57 @@
+ $ rm -rf d
+ $ mkdir -p d/patches
+ $ cd d
+
+ $ echo foo > foo
+ $ ln foo foo2
+ $ ls -l foo | awk '{ print $2 }'
+ > 2
+
+ $ quilt new test.diff
+ > Patch patches/test.diff is now on top
+
+ $ quilt add foo
+ > File foo added to patch patches/test.diff
+
+ $ ls -l foo | awk '{ print $2 }'
+ > 1
+
+ $ ls -l .pc/test.diff/foo | awk '{ print $2 }'
+ > 2
+
+ $ echo "foo changed" > foo
+ $ quilt refresh
+ > Refreshed patch patches/test.diff
+
+ $ quilt new test2.diff
+ > Patch patches/test2.diff is now on top
+
+ $ quilt add foo
+ > File foo added to patch patches/test2.diff
+
+ $ ls -l foo | awk '{ print $2 }'
+ > 1
+
+ $ ls -l .pc/test2.diff/foo | awk '{ print $2 }'
+ > 1
+
+ $ echo "foo changed again" > foo
+ $ quilt refresh
+ > Refreshed patch patches/test2.diff
+
+ $ quilt pop -q
+ > Removing patch patches/test2.diff
+ > Now at patch patches/test.diff
+
+ $ ls -l foo | awk '{ print $2 }'
+ > 1
+
+ $ quilt pop -q
+ > Removing patch patches/test.diff
+ > No patches applied
+
+ $ ls -l foo | awk '{ print $2 }'
+ > 2
+
+ $ cd ..
+ $ rm -rf d