diff options
-rw-r--r-- | quilt/refresh.in | 9 | ||||
-rw-r--r-- | test/refresh.test | 22 |
2 files changed, 29 insertions, 2 deletions
diff --git a/quilt/refresh.in b/quilt/refresh.in index 5245eeb..6c6b4d0 100644 --- a/quilt/refresh.in +++ b/quilt/refresh.in @@ -247,7 +247,7 @@ do fi done >> $tmp_patch -if ! [ -s $tmp_patch ] +if [ -n "$opt_fork" -a ! -s $tmp_patch ] then printf $"Nothing in patch %s\n" "$(print_patch "$patch")" >&2 die 1 @@ -347,7 +347,12 @@ then "$(print_patch "$old_patch")" \ "$(print_patch "$patch")" else - printf $"Refreshed patch %s\n" "$(print_patch "$patch")" + if [ -s $tmp_patch ] + then + printf $"Refreshed patch %s\n" "$(print_patch "$patch")" + else + printf $"Nothing in patch %s\n" "$(print_patch "$patch")" + fi fi touch "$QUILT_PC/$patch/.timestamp" else diff --git a/test/refresh.test b/test/refresh.test new file mode 100644 index 0000000..7bfcaae --- /dev/null +++ b/test/refresh.test @@ -0,0 +1,22 @@ + $ mkdir patches + + $ echo a > a + $ echo b > b + $ diff -u a b > patches/patch + $ echo patch -p0 > patches/series + $ rm -f b + $ quilt push -q + > Applying patch patches/patch + > Now at patch patches/patch + + $ echo a > a + $ quilt refresh + > Nothing in patch patches/patch + $ quilt pop + > Removing patch patches/patch + > Restoring a + > + > No patches applied + $ cat a + > a + $ cat patches/patch |