summaryrefslogtreecommitdiff
path: root/t/t3501-revert-cherry-pick.sh
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2010-10-31 14:59:33 -0500
committerJunio C Hamano <gitster@pobox.com>2010-11-10 08:49:26 -0800
commitf6ce1f25885f3db71935b201c5e3c858eb993f5c (patch)
tree142b6e4f329efcbc57c204779f0d77b52ffd9419 /t/t3501-revert-cherry-pick.sh
parentaf77aee9cac51c2036e6019b4aebec2049f03e6b (diff)
downloadgit-f6ce1f25885f3db71935b201c5e3c858eb993f5c.tar.gz
cherry-pick/revert: transparently refresh index
A stat-dirty index is not a detail that ought to concern the operator of porcelain such as "git cherry-pick". Without this change, a cherry-pick after copying a worktree with rsync errors out with a misleading message. $ git cherry-pick build/top error: Your local changes to 'file.h' would be overwritten by merge. Aborting. Please, commit your changes or stash them before you can merge. Noticed-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3501-revert-cherry-pick.sh')
-rwxr-xr-xt/t3501-revert-cherry-pick.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh
index bc7aedd048..043954422c 100755
--- a/t/t3501-revert-cherry-pick.sh
+++ b/t/t3501-revert-cherry-pick.sh
@@ -81,6 +81,16 @@ test_expect_success 'revert after renaming branch' '
'
+test_expect_success 'cherry-pick on stat-dirty working tree' '
+ git clone . copy &&
+ (
+ cd copy &&
+ git checkout initial &&
+ test-chmtime +40 oops &&
+ git cherry-pick added
+ )
+'
+
test_expect_success 'revert forbidden on dirty working tree' '
echo content >extra_file &&