Commit 57693d03 authored by Jon Seymour's avatar Jon Seymour Committed by Junio C Hamano

stash: fix git stash branch regression when branch creation fails

"git stash branch <branch> <stash>" started discarding the stash
when the branch creation fails.  It should have kept the stash
intact when aborting.
Signed-off-by: Jon Seymour's avatarJon Seymour <[email protected]>
Signed-off-by: default avatarJunio C Hamano <[email protected]>
parent 835d6a1f
......@@ -446,9 +446,9 @@ apply_to_branch () {
assert_stash_like "[email protected]"
git checkout -b $branch $REV^ &&
apply_stash "[email protected]"
test -z "$IS_STASH_REF" || drop_stash "[email protected]"
apply_stash "[email protected]" && {
test -z "$IS_STASH_REF" || drop_stash "[email protected]"
}
}
PARSE_CACHE='--not-parsed'
......
......@@ -545,7 +545,7 @@ test_expect_success 'invalid ref of the form [email protected]{n}, n >= N' '
git stash drop
'
test_expect_failure 'stash branch should not drop the stash if the branch exists' '
test_expect_success 'stash branch should not drop the stash if the branch exists' '
git stash clear &&
echo foo >file &&
git add file &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment