diff options
author | Jon Seymour <jon.seymour@gmail.com> | 2010-09-28 15:19:52 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-09-29 19:07:09 +0200 |
commit | 57693d03db93959831c9c017953f979aae6cc8eb (patch) | |
tree | 4caeb362b25864e84d90cea84028ecf743cb6974 /git-stash.sh | |
parent | stash drops the stash even if creating the branch fails because it already ex... (diff) | |
download | git-57693d03db93959831c9c017953f979aae6cc8eb.tar.xz git-57693d03db93959831c9c017953f979aae6cc8eb.zip |
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 <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-stash.sh')
-rwxr-xr-x | git-stash.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/git-stash.sh b/git-stash.sh index 57f36ce8dd..02113263e3 100755 --- a/git-stash.sh +++ b/git-stash.sh @@ -446,9 +446,9 @@ apply_to_branch () { assert_stash_like "$@" git checkout -b $branch $REV^ && - apply_stash "$@" - - test -z "$IS_STASH_REF" || drop_stash "$@" + apply_stash "$@" && { + test -z "$IS_STASH_REF" || drop_stash "$@" + } } PARSE_CACHE='--not-parsed' |