Skip to content

Commit

Permalink
stash pop: mention we did not drop the stash upon failing to apply
Browse files Browse the repository at this point in the history
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Feb 26, 2014
1 parent 2f93541 commit 2d4c993
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions git-stash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit 2d4c993

Please sign in to comment.