From 2d4c99339210d43a84841a71a50e88a050d9e21b Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 26 Feb 2014 14:18:54 -0800 Subject: [PATCH] stash pop: mention we did not drop the stash upon failing to apply Signed-off-by: Junio C Hamano --- git-stash.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/git-stash.sh b/git-stash.sh index 1e541a2125..72941be4da 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 () { -- 2.11.4.GIT