stash pop: mention we did not drop the stash upon failing to apply
authorJunio C Hamano <gitster@pobox.com>
Wed, 26 Feb 2014 22:18:54 +0000 (14:18 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 26 Feb 2014 22:18:54 +0000 (14:18 -0800)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-stash.sh
index 1e541a21257c70fa67c0fee552ccb05fc5b6a280..72941be4dab399e5e44154241340a0c9698f10a5 100755 (executable)
@@ -512,8 +512,14 @@ apply_stash () {
 pop_stash() {
        assert_stash_ref "$@"
 
-       apply_stash "$@" &&
-       drop_stash "$@"
+       if apply_stash "$@"
+       then
+               drop_stash "$@"
+       else
+               status=$?
+               say "The stash is kept in case you need it again."
+               exit $status
+       fi
 }
 
 drop_stash () {