From: Stephen Boyd <sboyd@codeaurora.org>
To: git@vger.kernel.org
Subject: [BUG/TEST 1/2] t3501: Expose bug with cherry-pick into dirty trees w/ renames
Date: Mon, 11 Feb 2013 20:27:41 -0800 [thread overview]
Message-ID: <1360643262-1472-2-git-send-email-sboyd@codeaurora.org> (raw)
In-Reply-To: <1360643262-1472-1-git-send-email-sboyd@codeaurora.org>
I encountered this bug while doing some cherry-picking into a
dirty tree. In this case, the working tree was dirty with some
changes to a file that had been renamed. The change I wanted to
cherry-pick was made along another branch before the rename and
it matched a subset of my working tree modulo the file rename.
When I cherry-picked the change from the other branch without the
rename to my current branch with the rename, the change applied
cleanly and the dirty bits were committed but the other dirty
bits in the file were lost. Make this into a test to expose this
bug.
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
t/t3501-revert-cherry-pick.sh | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh
index 6f489e2..eef4d8c 100755
--- a/t/t3501-revert-cherry-pick.sh
+++ b/t/t3501-revert-cherry-pick.sh
@@ -109,4 +109,32 @@ test_expect_success 'chery-pick on unborn branch' '
! test_cmp_rev initial HEAD
'
+test_expect_success 'cherry-pick on dirty rename should stay dirty' '
+ git checkout initial &&
+
+ for l in b c d e f g h i j k l m n o
+ do
+ echo $l$l$l$l$l$l$l$l$l
+ done >oops &&
+
+ test_tick &&
+ git add oops &&
+ git commit -m drop &&
+ git tag drop &&
+
+ git checkout initial &&
+ test_tick &&
+ git mv oops spoo &&
+ git commit -m rename3 &&
+ git tag rename3 &&
+
+ for l in b c d e f g h i j k m n o
+ do
+ echo $l$l$l$l$l$l$l$l$l
+ done >spoo &&
+
+ git cherry-pick drop &&
+ ! git diff --quiet
+'
+
test_done
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
next prev parent reply other threads:[~2013-02-12 4:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-12 4:27 [BUG/TEST 0/2] bugs with cherry-pick renames Stephen Boyd
2013-02-12 4:27 ` Stephen Boyd [this message]
2013-02-12 4:27 ` [BUG/TEST 2/2] t3501: Expose addinfo_cache error message in cherry-pick Stephen Boyd
2013-03-04 18:48 ` [BUG/TEST 0/2] bugs with cherry-pick renames Stephen Boyd
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=1360643262-1472-2-git-send-email-sboyd@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=git@vger.kernel.org \
/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).