From: Tomas Carnecky <tom@dbservice.com>
To: Jon Seymour <jon.seymour@gmail.com>
Cc: git@vger.kernel.org, tla@land.ru, gitster@pobox.com
Subject: Re: [PATCH 1/2] stash drops the stash even if creating the branch fails because it already exists
Date: Tue, 28 Sep 2010 15:21:55 +0200 [thread overview]
Message-ID: <4CA1EBF3.7090701@dbservice.com> (raw)
In-Reply-To: <1285679992-7638-2-git-send-email-jon.seymour@gmail.com>
On 9/28/10 3:19 PM, Jon Seymour wrote:
> From: Tomas Carnecky <tom@dbservice.com>
>
> 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@dbservice.com>
> ---
> 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
next prev parent reply other threads:[~2010-09-28 13:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-28 11:25 [PATCH] stash drops the stash even if creating the branch fails because it already exists Tomas Carnecky
2010-09-28 13:19 ` [PATCH 0/2] stash: test and fix git stash branch regression Jon Seymour
2010-09-28 13:19 ` [PATCH 1/2] stash drops the stash even if creating the branch fails because it already exists Jon Seymour
2010-09-28 13:21 ` Tomas Carnecky [this message]
2010-09-29 13:53 ` Jon Seymour
2010-09-28 13:19 ` [PATCH 2/2] stash: fix git stash branch regression when branch creation fails Jon Seymour
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CA1EBF3.7090701@dbservice.com \
--to=tom@dbservice.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jon.seymour@gmail.com \
--cc=tla@land.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).