summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2015-02-25 09:00:17 +0100
committerJean Delvare <jdelvare@suse.de>2015-02-25 09:00:17 +0100
commit53aaf3f477dd2d030766fab55d3b14386abe2afa (patch)
tree556ad7a4f4631f4b72fb8d90460638074cbc5635 /test
parent8fe2ce95f77a39ecf7e0fc567534bf2349259e22 (diff)
downloadquilt-53aaf3f477dd2d030766fab55d3b14386abe2afa.tar.gz
refresh: Break links to read-only patch files
We just changed the behavior of the refresh command to no longer break symbolic links. While preserving the links is the right thing to do in the general case, this approach fails if the patch file is read-only. In that case we want to replace the link itself with the refreshed patch, as we used to.
Diffstat (limited to 'test')
-rw-r--r--test/symlink.test48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/symlink.test b/test/symlink.test
index 9e5e797..4610af6 100644
--- a/test/symlink.test
+++ b/test/symlink.test
@@ -51,3 +51,51 @@
> @@ -1 +1 @@
> -foo
> +foo changed 2
+
+# Test the refresh when target is read-only
+ $ chmod -w test.diff
+ $ echo "foo changed 4" > foo
+ $ quilt refresh --no-index -p ab
+ > Refreshed patch patches/test.diff
+
+ $ readlink patches/test.diff
+ $ echo %{?}
+ > 1
+
+ $ cat patches/test.diff
+ > --- a/foo
+ > +++ b/foo
+ > @@ -1 +1 @@
+ > -foo
+ > +foo changed 4
+
+# Test the refresh --backup when target is read-only
+ $ mv patches/test.diff .
+ $ ln -s ../test.diff patches/test.diff
+ $ chmod -w test.diff
+
+ $ echo "foo changed 5" > foo
+ $ quilt refresh --backup --no-index -p ab
+ > Refreshed patch patches/test.diff
+
+ $ readlink patches/test.diff
+ $ echo %{?}
+ > 1
+
+ $ cat patches/test.diff
+ > --- a/foo
+ > +++ b/foo
+ > @@ -1 +1 @@
+ > -foo
+ > +foo changed 5
+
+ $ readlink patches/test.diff~
+ $ echo %{?}
+ > 1
+
+ $ cat patches/test.diff~
+ > --- a/foo
+ > +++ b/foo
+ > @@ -1 +1 @@
+ > -foo
+ > +foo changed 4