summaryrefslogtreecommitdiff
path: root/git-stash.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-03-21 12:48:51 -0700
committerJunio C Hamano <gitster@pobox.com>2014-03-21 12:48:51 -0700
commit10bdb20d6a6841b22a3327e3e0fbdd6b5521eb96 (patch)
treec9bfae45a7a43b6520339c3a421d0994b58dc00a /git-stash.sh
parent1be645c0b1b2218d58fbae9dd6174ff2a9d66d57 (diff)
parent2d4c99339210d43a84841a71a50e88a050d9e21b (diff)
downloadgit-10bdb20d6a6841b22a3327e3e0fbdd6b5521eb96.tar.gz
Merge branch 'jc/stash-pop-not-popped'
"stash pop", upon failing to apply the stash, refrains from discarding the stash to avoid information loss. Be more explicit in the error message. The wording may want to get a bit more bikeshedding. * jc/stash-pop-not-popped: stash pop: mention we did not drop the stash upon failing to apply
Diffstat (limited to 'git-stash.sh')
-rwxr-xr-xgit-stash.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/git-stash.sh b/git-stash.sh
index f0a94abf14..4798bcf0e5 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 () {