summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
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