summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2014-10-29 11:41:36 +0100
committerJean Delvare <jdelvare@suse.de>2014-10-29 11:41:36 +0100
commitc5e0be9363565ac94f7664f2f166b5b8f45a8fe0 (patch)
treef9add2858240c802f15ea9eddc4f52b5e2d2b732
parent54268c1aab28ce763ec028982bf54236488dacc5 (diff)
downloadquilt-c5e0be9363565ac94f7664f2f166b5b8f45a8fe0.tar.gz
push: Fix handling of "quilt push 0"
"quilt push 0" returns the following cryptic message: Now at patch patches/quilt So add the same check we already have in command pop and detect when nothing needs to be done, returning the more sane message: No patch applied
-rw-r--r--quilt/push.in5
-rw-r--r--test/three.test10
2 files changed, 15 insertions, 0 deletions
diff --git a/quilt/push.in b/quilt/push.in
index e00573d..e907089 100644
--- a/quilt/push.in
+++ b/quilt/push.in
@@ -399,6 +399,11 @@ then
fi
patches=$(list_patches)
+if [ -z "$patches" ]
+then
+ printf $"No patch applied\n" >&2
+ exit 2
+fi
# In theory, these patches can't be already applied. However in the case
# of a generated or manually tweaked series file, this could happen and
diff --git a/test/three.test b/test/three.test
index 208c21f..abbd5a3 100644
--- a/test/three.test
+++ b/test/three.test
@@ -214,3 +214,13 @@
> Removing patch patches/patch2.diff
> Removing patch patches/patch1.diff
> No patches applied
+
+ $ quilt push 0
+ > No patch applied
+ $ echo %{?}
+ > 2
+
+ $ quilt pop 0
+ > No patch removed
+ $ echo %{?}
+ > 2