Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 2d4c993

Browse files
committed
stash pop: mention we did not drop the stash upon failing to apply
Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2f93541 commit 2d4c993

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

git-stash.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,14 @@ apply_stash () {
512512
pop_stash() {
513513
assert_stash_ref "$@"
514514

515-
apply_stash "$@" &&
516-
drop_stash "$@"
515+
if apply_stash "$@"
516+
then
517+
drop_stash "$@"
518+
else
519+
status=$?
520+
say "The stash is kept in case you need it again."
521+
exit $status
522+
fi
517523
}
518524

519525
drop_stash () {

0 commit comments

Comments
 (0)