2008-08-10 11:48:55 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
test_description='cherry-pick should rerere for conflicts'
|
|
|
|
|
|
|
|
. ./test-lib.sh
|
|
|
|
|
|
|
|
test_expect_success setup '
|
2017-08-02 10:44:18 +00:00
|
|
|
test_commit foo &&
|
|
|
|
test_commit foo-master foo &&
|
|
|
|
|
|
|
|
git checkout -b dev foo &&
|
|
|
|
test_commit foo-dev foo &&
|
2008-08-10 11:48:55 +00:00
|
|
|
git config rerere.enabled true
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'conflicting merge' '
|
|
|
|
test_must_fail git merge master
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'fixup' '
|
2017-08-02 10:44:18 +00:00
|
|
|
echo foo-resolved >foo &&
|
|
|
|
git commit -am resolved &&
|
|
|
|
cp foo expect &&
|
|
|
|
git reset --hard HEAD^
|
2008-08-10 11:48:55 +00:00
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'cherry-pick conflict' '
|
|
|
|
test_must_fail git cherry-pick master &&
|
|
|
|
test_cmp expect foo
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'reconfigure' '
|
2010-10-31 01:46:54 +00:00
|
|
|
git config rerere.enabled false &&
|
2008-08-10 11:48:55 +00:00
|
|
|
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
|