summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 835d6a1)
raw | patch | inline | side by side (parent: 835d6a1)
author | Jon Seymour <jon.seymour@gmail.com> | |
Tue, 28 Sep 2010 13:19:52 +0000 (23:19 +1000) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 29 Sep 2010 17:07:09 +0000 (10:07 -0700) |
"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>
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>
git-stash.sh | patch | blob | history | |
t/t3903-stash.sh | patch | blob | history |
diff --git a/git-stash.sh b/git-stash.sh
index 57f36ce8dd7cd25e269f8e31d6fdc668d62811f9..02113263e3d84b49aae8d2961a53c598c797584d 100755 (executable)
--- a/git-stash.sh
+++ b/git-stash.sh
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'
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index 4215cc698613879e22adcc5e68d3f8ee6281940e..903a122efe0c54cb44eb6c3e7ed04bdbab81439d 100755 (executable)
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
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 &&