Junio, Let me know if you want me to re-roll this series with Tomas' sign-off. I can also add my simplification of the Brian's fix and another fix I have made to have git stash save/create fail early in case the index contains merge conflicts. jon. On Tue, Sep 28, 2010 at 11:21 PM, Tomas Carnecky <tom@xxxxxxxxxxxxx> wrote: > On 9/28/10 3:19 PM, Jon Seymour wrote: >> From: Tomas Carnecky <tom@xxxxxxxxxxxxx> >> >> 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. I think that shouldn't happen, >> so here is a test. > > This line was missing from my original patch, sorry about that: > Signed-off-by: Tomas Carnecky <tom@xxxxxxxxxxxxx> > >> --- >> Ât/t3903-stash.sh | Â 11 +++++++++++ >> Â1 files changed, 11 insertions(+), 0 deletions(-) >> >> diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh >> index 9ed2396..0f6b2e4 100755 >> --- 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 > > > -- > To unsubscribe from this list: send the line "unsubscribe git" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at Âhttp://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html