mirror of
https://github.com/git/git.git
synced 2024-11-05 08:47:56 +01:00
a48fcd8369
Breaks in a test assertion's && chain can potentially hide failures from earlier commands in the chain. Commands intended to fail should be marked with !, test_must_fail, or test_might_fail. The examples in this patch do not require that. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
45 lines
988 B
Bash
Executable file
45 lines
988 B
Bash
Executable file
#!/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
|