X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft7601-merge-pull-config.sh;h=7ba94ea99bc0785da5b398e494d23469ba44992d;hb=e782e12f89955dfb0be82098af3cfdd8dd0eaf80;hp=95b4d71c5154a62bc2e483eecccada0079bf05f4;hpb=679639904da05f7d84e9215960e76dd0f3353328;p=git.git diff --git a/t/t7601-merge-pull-config.sh b/t/t7601-merge-pull-config.sh index 95b4d71c5..7ba94ea99 100755 --- a/t/t7601-merge-pull-config.sh +++ b/t/t7601-merge-pull-config.sh @@ -1,6 +1,6 @@ #!/bin/sh -test_description='git-merge +test_description='git merge Testing pull.* configuration parsing.' @@ -112,6 +112,21 @@ test_expect_success 'setup conflicted merge' ' # recusive is choosen. test_expect_success 'merge picks up the best result' ' + git config --unset-all pull.twohead && + git reset --hard c5 && + git merge -s resolve c6 + resolve_count=$(conflict_count) && + git reset --hard c5 && + git merge -s recursive c6 + recursive_count=$(conflict_count) && + git reset --hard c5 && + git merge -s recursive -s resolve c6 + auto_count=$(conflict_count) && + test $auto_count = $recursive_count && + test $auto_count != $resolve_count +' + +test_expect_success 'merge picks up the best result (from config)' ' git config pull.twohead "recursive resolve" && git reset --hard c5 && git merge -s resolve c6 @@ -126,4 +141,16 @@ test_expect_success 'merge picks up the best result' ' test $auto_count != $resolve_count ' +test_expect_success 'merge errors out on invalid strategy' ' + git config pull.twohead "foobar" && + git reset --hard c5 && + test_must_fail git merge c6 +' + +test_expect_success 'merge errors out on invalid strategy' ' + git config --unset-all pull.twohead && + git reset --hard c5 && + test_must_fail git merge -s "resolve recursive" c6 +' + test_done