summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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