From: Charles Bailey <charles@hashpling.org>
To: git@vger.kernel.org, khellls@gmail.com
Cc: Charles Bailey <charles@hashpling.org>
Subject: [PATCH 1/2] stash bug: stash can lose data in a file removed from the index
Date: Sat, 10 Apr 2010 19:14:00 +0100 [thread overview]
Message-ID: <1270923241-14383-1-git-send-email-charles@hashpling.org> (raw)
In-Reply-To: <v2w918f64e01004101104xd4f1b4eciec01d2e87691ee72@mail.gmail.com>
If a file is removed from the index and then modified in the working
tree then stash will discard the working tree file with no way to
recover the changes.
This can might be done in one of a number of ways.
git rm file
vi file # edit a new version
git stash
or with git mv
git mv file newfile
vi file # make a new file with the old name
git stash
Signed-off-by: Charles Bailey <charles@hashpling.org>
---
t/t3903-stash.sh | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index 476e5ec..c85bf44 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -228,4 +228,13 @@ test_expect_success 'stash --invalid-option' '
test bar,bar2 = $(cat file),$(cat file2)
'
+test_expect_failure 'stash git rm' '
+ git reset --hard &&
+ git rm file &&
+ echo bar7 > file &&
+ git stash &&
+ git stash apply &&
+ test bar7 = $(cat file)
+'
+
test_done
--
1.7.1.rc0.266.gf3d756
next prev parent reply other threads:[~2010-04-10 18:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-10 18:04 Strange case with stash Khaled al Habache
2010-04-10 18:14 ` Charles Bailey [this message]
2010-04-12 21:44 ` [PATCH 1/2] stash bug: stash can lose data in a file removed from the index Charles Bailey
2010-04-10 18:14 ` [PATCH 2/2] stash: Don't overwrite files that have gone " Charles Bailey
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=1270923241-14383-1-git-send-email-charles@hashpling.org \
--to=charles@hashpling.org \
--cc=git@vger.kernel.org \
--cc=khellls@gmail.com \
/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).