diff options
author | Abhijit Menon-Sen <ams@toroid.org> | 2008-08-10 17:18:55 +0530 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-08-11 16:42:49 -0700 |
commit | aa1a0111cc0e2a12c21ed05c88d8e9872fc166b2 (patch) | |
tree | 2d16c9378afe871dffedcf115c03d69b529d493b /t | |
parent | ac39efbdf3d41443c40166b7578b7fb87c2f3b60 (diff) | |
download | git-aa1a0111cc0e2a12c21ed05c88d8e9872fc166b2.tar.gz git-aa1a0111cc0e2a12c21ed05c88d8e9872fc166b2.tar.xz |
Make cherry-pick use rerere for conflict resolution.
Cherry-picking can be helped by reusing previous confliction
resolution by invoking rerere automatically.
Signed-off-by: Abhijit Menon-Sen <ams@toroid.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t3504-cherry-pick-rerere.sh | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/t/t3504-cherry-pick-rerere.sh b/t/t3504-cherry-pick-rerere.sh new file mode 100755 index 000000000..f7b3518a3 --- /dev/null +++ b/t/t3504-cherry-pick-rerere.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +test_description='cherry-pick should rerere for conflicts' + +. ./test-lib.sh + +test_expect_success setup ' + echo foo >foo && + git add foo && test_tick && git commit -q -m 1 && + echo foo-master >foo && + git add foo && test_tick && git commit -q -m 2 && + + git checkout -b dev HEAD^ && + echo foo-dev >foo && + git add foo && test_tick && git commit -q -m 3 && + git config rerere.enabled true +' + +test_expect_success 'conflicting merge' ' + test_must_fail git merge master +' + +test_expect_success 'fixup' ' + echo foo-dev >foo && + git add foo && test_tick && git commit -q -m 4 && + git reset --hard HEAD^ + echo foo-dev >expect +' + +test_expect_success 'cherry-pick conflict' ' + test_must_fail git cherry-pick master && + test_cmp expect foo +' + +test_expect_success 'reconfigure' ' + git config rerere.enabled false + git reset --hard +' + +test_expect_success 'cherry-pick conflict without rerere' ' + test_must_fail git cherry-pick master && + test_must_fail test_cmp expect foo +' + +test_done |