-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Abhijit Menon-Sen
authored and
Junio C Hamano
committed
Aug 11, 2008
1 parent
ac39efb
commit aa1a011
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |