Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
stash drops the stash even if creating the branch fails because it already exists
author
Tomas Carnecky
<tom@dbservice.com>
Tue, 28 Sep 2010 13:19:51 +0000
(23:19 +1000)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 29 Sep 2010 16:59:42 +0000
(09:59 -0700)
This bug was disovered by someone on IRC when he tried to
$ git stash branch <branch> <stash>
while <branch> already existed. In that case the stash is dropped even
though it isn't applied on any branch, so the stash is effectively lost.
Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3903-stash.sh
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
442cb08
)
diff --git
a/t/t3903-stash.sh
b/t/t3903-stash.sh
index 9ed2396e29fb6f573f32e12c1dd4182086d60b04..4215cc698613879e22adcc5e68d3f8ee6281940e 100755
(executable)
--- a/
t/t3903-stash.sh
+++ b/
t/t3903-stash.sh
@@
-545,4
+545,15
@@
test_expect_success 'invalid ref of the form stash@{n}, n >= N' '
git stash drop
'
+test_expect_failure 'stash branch should not drop the stash if the branch exists' '
+ git stash clear &&
+ echo foo >file &&
+ git add file &&
+ git commit -m initial &&
+ echo bar >file &&
+ git stash &&
+ test_must_fail git stash branch master stash@{0} &&
+ git rev-parse stash@{0} --
+'
+
test_done