summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit-stash.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/git-stash.sh b/git-stash.sh
index f0a94ab..4798bcf 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -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 () {