t3504: use test_commit

Using test_commit is simpler than chaining echo && git add &&
test_tick && commit. Also having tags makes it clearer which commit
is being selecting by reset.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Phillip Wood 2017-08-02 11:44:18 +01:00 committed by Junio C Hamano
parent 9b6d7a6245
commit 6f0e577e46

View File

@ -5,14 +5,11 @@ test_description='cherry-pick should rerere for conflicts'
. ./test-lib.sh . ./test-lib.sh
test_expect_success setup ' test_expect_success setup '
echo foo >foo && test_commit foo &&
git add foo && test_tick && git commit -q -m 1 && test_commit foo-master foo &&
echo foo-master >foo &&
git add foo && test_tick && git commit -q -m 2 &&
git checkout -b dev HEAD^ && git checkout -b dev foo &&
echo foo-dev >foo && test_commit foo-dev foo &&
git add foo && test_tick && git commit -q -m 3 &&
git config rerere.enabled true git config rerere.enabled true
' '
@ -21,10 +18,10 @@ test_expect_success 'conflicting merge' '
' '
test_expect_success 'fixup' ' test_expect_success 'fixup' '
echo foo-dev >foo && echo foo-resolved >foo &&
git add foo && test_tick && git commit -q -m 4 && git commit -am resolved &&
git reset --hard HEAD^ && cp foo expect &&
echo foo-dev >expect git reset --hard HEAD^
' '
test_expect_success 'cherry-pick conflict' ' test_expect_success 'cherry-pick conflict' '