{"thread":{"id":"37733","subject":"[PATCH 4/5] t7610-mergetool: prefer test_config over git config","startedAt":"2014-10-15T08:35:17Z","lastAt":"2014-10-16T05:30:04Z","messageCount":7,"participants":["David Aguilar","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"250671","messageId":"1413362121-17361-1-git-send-email-davvid@gmail.com","threadId":"37733","inReplyTo":null,"subject":"[PATCH 1/5] t7610-mergetool: use tabs instead of a mix of tabs and spaces","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2014-10-15T08:35:17Z","receivedAt":"2014-10-15T08:35:17Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"Signed-off-by: David Aguilar <davvid@gmail.com>\n---\n t/t7610-mergetool.sh | 918 +++++++++++++++++++++++++--------------------------\n 1 file changed, 459 insertions(+), 459 deletions(-)\n\ndiff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh\nindex 05d9db0..875c8af 100755\n--- a/t/t7610-mergetool.sh\n+++ b/t/t7610-mergetool.sh\n@@ -14,512 +14,512 @@ Testing basic merge tool invocation'\n # running mergetool\n \n test_expect_success 'setup' '\n-    git config rerere.enabled true &&\n-    echo master >file1 &&\n-    echo master spaced >\"spaced name\" &&\n-    echo master file11 >file11 &&\n-    echo master file12 >file12 &&\n-    echo master file13 >file13 &&\n-    echo master file14 >file14 &&\n-    mkdir subdir &&\n-    echo master sub >subdir/file3 &&\n-    test_create_repo submod &&\n-    (\n-\tcd submod &&\n-\t: >foo &&\n-\tgit add foo &&\n-\tgit commit -m \"Add foo\"\n-    ) &&\n-    git submodule add git://example.com/submod submod &&\n-    git add file1 \"spaced name\" file1[1-4] subdir/file3 .gitmodules submod &&\n-    git commit -m \"add initial versions\" &&\n-\n-    git checkout -b branch1 master &&\n-    git submodule update -N &&\n-    echo branch1 change >file1 &&\n-    echo branch1 newfile >file2 &&\n-    echo branch1 spaced >\"spaced name\" &&\n-    echo branch1 both added >both &&\n-    echo branch1 change file11 >file11 &&\n-    echo branch1 change file13 >file13 &&\n-    echo branch1 sub >subdir/file3 &&\n-    (\n-\tcd submod &&\n-\techo branch1 submodule >bar &&\n-\tgit add bar &&\n-\tgit commit -m \"Add bar on branch1\" &&\n-\tgit checkout -b submod-branch1\n-    ) &&\n-    git add file1 \"spaced name\" file11 file13 file2 subdir/file3 submod &&\n-    git add both &&\n-    git rm file12 &&\n-    git commit -m \"branch1 changes\" &&\n-\n-    git checkout -b stash1 master &&\n-    echo stash1 change file11 >file11 &&\n-    git add file11 &&\n-    git commit -m \"stash1 changes\" &&\n-\n-    git checkout -b stash2 master &&\n-    echo stash2 change file11 >file11 &&\n-    git add file11 &&\n-    git commit -m \"stash2 changes\" &&\n-\n-    git checkout master &&\n-    git submodule update -N &&\n-    echo master updated >file1 &&\n-    echo master new >file2 &&\n-    echo master updated spaced >\"spaced name\" &&\n-    echo master both added >both &&\n-    echo master updated file12 >file12 &&\n-    echo master updated file14 >file14 &&\n-    echo master new sub >subdir/file3 &&\n-    (\n-\tcd submod &&\n-\techo master submodule >bar &&\n-\tgit add bar &&\n-\tgit commit -m \"Add bar on master\" &&\n-\tgit checkout -b submod-master\n-    ) &&\n-    git add file1 \"spaced name\" file12 file14 file2 subdir/file3 submod &&\n-    git add both &&\n-    git rm file11 &&\n-    git commit -m \"master updates\" &&\n-\n-    git config merge.tool mytool &&\n-    git config mergetool.mytool.cmd \"cat \\\"\\$REMOTE\\\" >\\\"\\$MERGED\\\"\" &&\n-    git config mergetool.mytool.trustExitCode true &&\n-    git config mergetool.mybase.cmd \"cat \\\"\\$BASE\\\" >\\\"\\$MERGED\\\"\" &&\n-    git config mergetool.mybase.trustExitCode true\n+\tgit config rerere.enabled true &&\n+\techo master >file1 &&\n+\techo master spaced >\"spaced name\" &&\n+\techo master file11 >file11 &&\n+\techo master file12 >file12 &&\n+\techo master file13 >file13 &&\n+\techo master file14 >file14 &&\n+\tmkdir subdir &&\n+\techo master sub >subdir/file3 &&\n+\ttest_create_repo submod &&\n+\t(\n+\t\tcd submod &&\n+\t\t: >foo &&\n+\t\tgit add foo &&\n+\t\tgit commit -m \"Add foo\"\n+\t) &&\n+\tgit submodule add git://example.com/submod submod &&\n+\tgit add file1 \"spaced name\" file1[1-4] subdir/file3 .gitmodules submod &&\n+\tgit commit -m \"add initial versions\" &&\n+\n+\tgit checkout -b branch1 master &&\n+\tgit submodule update -N &&\n+\techo branch1 change >file1 &&\n+\techo branch1 newfile >file2 &&\n+\techo branch1 spaced >\"spaced name\" &&\n+\techo branch1 both added >both &&\n+\techo branch1 change file11 >file11 &&\n+\techo branch1 change file13 >file13 &&\n+\techo branch1 sub >subdir/file3 &&\n+\t(\n+\t\tcd submod &&\n+\t\techo branch1 submodule >bar &&\n+\t\tgit add bar &&\n+\t\tgit commit -m \"Add bar on branch1\" &&\n+\t\tgit checkout -b submod-branch1\n+\t) &&\n+\tgit add file1 \"spaced name\" file11 file13 file2 subdir/file3 submod &&\n+\tgit add both &&\n+\tgit rm file12 &&\n+\tgit commit -m \"branch1 changes\" &&\n+\n+\tgit checkout -b stash1 master &&\n+\techo stash1 change file11 >file11 &&\n+\tgit add file11 &&\n+\tgit commit -m \"stash1 changes\" &&\n+\n+\tgit checkout -b stash2 master &&\n+\techo stash2 change file11 >file11 &&\n+\tgit add file11 &&\n+\tgit commit -m \"stash2 changes\" &&\n+\n+\tgit checkout master &&\n+\tgit submodule update -N &&\n+\techo master updated >file1 &&\n+\techo master new >file2 &&\n+\techo master updated spaced >\"spaced name\" &&\n+\techo master both added >both &&\n+\techo master updated file12 >file12 &&\n+\techo master updated file14 >file14 &&\n+\techo master new sub >subdir/file3 &&\n+\t(\n+\t\tcd submod &&\n+\t\techo master submodule >bar &&\n+\t\tgit add bar &&\n+\t\tgit commit -m \"Add bar on master\" &&\n+\t\tgit checkout -b submod-master\n+\t) &&\n+\tgit add file1 \"spaced name\" file12 file14 file2 subdir/file3 submod &&\n+\tgit add both &&\n+\tgit rm file11 &&\n+\tgit commit -m \"master updates\" &&\n+\n+\tgit config merge.tool mytool &&\n+\tgit config mergetool.mytool.cmd \"cat \\\"\\$REMOTE\\\" >\\\"\\$MERGED\\\"\" &&\n+\tgit config mergetool.mytool.trustExitCode true &&\n+\tgit config mergetool.mybase.cmd \"cat \\\"\\$BASE\\\" >\\\"\\$MERGED\\\"\" &&\n+\tgit config mergetool.mybase.trustExitCode true\n '\n \n test_expect_success 'custom mergetool' '\n-    git checkout -b test1 branch1 &&\n-    git submodule update -N &&\n-    test_must_fail git merge master >/dev/null 2>&1 &&\n-    ( yes \"\" | git mergetool both >/dev/null 2>&1 ) &&\n-    ( yes \"\" | git mergetool file1 file1 ) &&\n-    ( yes \"\" | git mergetool file2 \"spaced name\" >/dev/null 2>&1 ) &&\n-    ( yes \"\" | git mergetool subdir/file3 >/dev/null 2>&1 ) &&\n-    ( yes \"d\" | git mergetool file11 >/dev/null 2>&1 ) &&\n-    ( yes \"d\" | git mergetool file12 >/dev/null 2>&1 ) &&\n-    ( yes \"l\" | git mergetool submod >/dev/null 2>&1 ) &&\n-    test \"$(cat file1)\" = \"master updated\" &&\n-    test \"$(cat file2)\" = \"master new\" &&\n-    test \"$(cat subdir/file3)\" = \"master new sub\" &&\n-    test \"$(cat submod/bar)\" = \"branch1 submodule\" &&\n-    git commit -m \"branch1 resolved with mergetool\"\n+\tgit checkout -b test1 branch1 &&\n+\tgit submodule update -N &&\n+\ttest_must_fail git merge master >/dev/null 2>&1 &&\n+\t( yes \"\" | git mergetool both >/dev/null 2>&1 ) &&\n+\t( yes \"\" | git mergetool file1 file1 ) &&\n+\t( yes \"\" | git mergetool file2 \"spaced name\" >/dev/null 2>&1 ) &&\n+\t( yes \"\" | git mergetool subdir/file3 >/dev/null 2>&1 ) &&\n+\t( yes \"d\" | git mergetool file11 >/dev/null 2>&1 ) &&\n+\t( yes \"d\" | git mergetool file12 >/dev/null 2>&1 ) &&\n+\t( yes \"l\" | git mergetool submod >/dev/null 2>&1 ) &&\n+\ttest \"$(cat file1)\" = \"master updated\" &&\n+\ttest \"$(cat file2)\" = \"master new\" &&\n+\ttest \"$(cat subdir/file3)\" = \"master new sub\" &&\n+\ttest \"$(cat submod/bar)\" = \"branch1 submodule\" &&\n+\tgit commit -m \"branch1 resolved with mergetool\"\n '\n \n test_expect_success 'mergetool crlf' '\n-    git config core.autocrlf true &&\n-    git checkout -b test2 branch1 &&\n-    test_must_fail git merge master >/dev/null 2>&1 &&\n-    ( yes \"\" | git mergetool file1 >/dev/null 2>&1 ) &&\n-    ( yes \"\" | git mergetool file2 >/dev/null 2>&1 ) &&\n-    ( yes \"\" | git mergetool \"spaced name\" >/dev/null 2>&1 ) &&\n-    ( yes \"\" | git mergetool both >/dev/null 2>&1 ) &&\n-    ( yes \"\" | git mergetool subdir/file3 >/dev/null 2>&1 ) &&\n-    ( yes \"d\" | git mergetool file11 >/dev/null 2>&1 ) &&\n-    ( yes \"d\" | git mergetool file12 >/dev/null 2>&1 ) &&\n-    ( yes \"r\" | git mergetool submod >/dev/null 2>&1 ) &&\n-    test \"$(printf x | cat file1 -)\" = \"$(printf \"master updated\\r\\nx\")\" &&\n-    test \"$(printf x | cat file2 -)\" = \"$(printf \"master new\\r\\nx\")\" &&\n-    test \"$(printf x | cat subdir/file3 -)\" = \"$(printf \"master new sub\\r\\nx\")\" &&\n-    git submodule update -N &&\n-    test \"$(cat submod/bar)\" = \"master submodule\" &&\n-    git commit -m \"branch1 resolved with mergetool - autocrlf\" &&\n-    git config core.autocrlf false &&\n-    git reset --hard\n+\tgit config core.autocrlf true &&\n+\tgit checkout -b test2 branch1 &&\n+\ttest_must_fail git merge master >/dev/null 2>&1 &&\n+\t( yes \"\" | git mergetool file1 >/dev/null 2>&1 ) &&\n+\t( yes \"\" | git mergetool file2 >/dev/null 2>&1 ) &&\n+\t( yes \"\" | git mergetool \"spaced name\" >/dev/null 2>&1 ) &&\n+\t( yes \"\" | git mergetool both >/dev/null 2>&1 ) &&\n+\t( yes \"\" | git mergetool subdir/file3 >/dev/null 2>&1 ) &&\n+\t( yes \"d\" | git mergetool file11 >/dev/null 2>&1 ) &&\n+\t( yes \"d\" | git mergetool file12 >/dev/null 2>&1 ) &&\n+\t( yes \"r\" | git mergetool submod >/dev/null 2>&1 ) &&\n+\ttest \"$(printf x | cat file1 -)\" = \"$(printf \"master updated\\r\\nx\")\" &&\n+\ttest \"$(printf x | cat file2 -)\" = \"$(printf \"master new\\r\\nx\")\" &&\n+\ttest \"$(printf x | cat subdir/file3 -)\" = \"$(printf \"master new sub\\r\\nx\")\" &&\n+\tgit submodule update -N &&\n+\ttest \"$(cat submod/bar)\" = \"master submodule\" &&\n+\tgit commit -m \"branch1 resolved with mergetool - autocrlf\" &&\n+\tgit config core.autocrlf false &&\n+\tgit reset --hard\n '\n \n test_expect_success 'mergetool in subdir' '\n-    git checkout -b test3 branch1 &&\n-    git submodule update -N &&\n-    (\n-\tcd subdir &&\n-\ttest_must_fail git merge master >/dev/null 2>&1 &&\n-\t( yes \"\" | git mergetool file3 >/dev/null 2>&1 ) &&\n-\ttest \"$(cat file3)\" = \"master new sub\"\n-    )\n+\tgit checkout -b test3 branch1 &&\n+\tgit submodule update -N &&\n+\t(\n+\t\tcd subdir &&\n+\t\ttest_must_fail git merge master >/dev/null 2>&1 &&\n+\t\t( yes \"\" | git mergetool file3 >/dev/null 2>&1 ) &&\n+\t\ttest \"$(cat file3)\" = \"master new sub\"\n+\t)\n '\n \n test_expect_success 'mergetool on file in parent dir' '\n-    (\n-\tcd subdir &&\n-\t( yes \"\" | git mergetool ../file1 >/dev/null 2>&1 ) &&\n-\t( yes \"\" | git mergetool ../file2 ../spaced\\ name >/dev/null 2>&1 ) &&\n-\t( yes \"\" | git mergetool ../both >/dev/null 2>&1 ) &&\n-\t( yes \"d\" | git mergetool ../file11 >/dev/null 2>&1 ) &&\n-\t( yes \"d\" | git mergetool ../file12 >/dev/null 2>&1 ) &&\n-\t( yes \"l\" | git mergetool ../submod >/dev/null 2>&1 ) &&\n-\ttest \"$(cat ../file1)\" = \"master updated\" &&\n-\ttest \"$(cat ../file2)\" = \"master new\" &&\n-\ttest \"$(cat ../submod/bar)\" = \"branch1 submodule\" &&\n-\tgit commit -m \"branch1 resolved with mergetool - subdir\"\n-    )\n+\t(\n+\t\tcd subdir &&\n+\t\t( yes \"\" | git mergetool ../file1 >/dev/null 2>&1 ) &&\n+\t\t( yes \"\" | git mergetool ../file2 ../spaced\\ name >/dev/null 2>&1 ) &&\n+\t\t( yes \"\" | git mergetool ../both >/dev/null 2>&1 ) &&\n+\t\t( yes \"d\" | git mergetool ../file11 >/dev/null 2>&1 ) &&\n+\t\t( yes \"d\" | git mergetool ../file12 >/dev/null 2>&1 ) &&\n+\t\t( yes \"l\" | git mergetool ../submod >/dev/null 2>&1 ) &&\n+\t\ttest \"$(cat ../file1)\" = \"master updated\" &&\n+\t\ttest \"$(cat ../file2)\" = \"master new\" &&\n+\t\ttest \"$(cat ../submod/bar)\" = \"branch1 submodule\" &&\n+\t\tgit commit -m \"branch1 resolved with mergetool - subdir\"\n+\t)\n '\n \n test_expect_success 'mergetool skips autoresolved' '\n-    git checkout -b test4 branch1 &&\n-    git submodule update -N &&\n-    test_must_fail git merge master &&\n-    test -n \"$(git ls-files -u)\" &&\n-    ( yes \"d\" | git mergetool file11 >/dev/null 2>&1 ) &&\n-    ( yes \"d\" | git mergetool file12 >/dev/null 2>&1 ) &&\n-    ( yes \"l\" | git mergetool submod >/dev/null 2>&1 ) &&\n-    output=\"$(git mergetool --no-prompt)\" &&\n-    test \"$output\" = \"No files need merging\" &&\n-    git reset --hard\n+\tgit checkout -b test4 branch1 &&\n+\tgit submodule update -N &&\n+\ttest_must_fail git merge master &&\n+\ttest -n \"$(git ls-files -u)\" &&\n+\t( yes \"d\" | git mergetool file11 >/dev/null 2>&1 ) &&\n+\t( yes \"d\" | git mergetool file12 >/dev/null 2>&1 ) &&\n+\t( yes \"l\" | git mergetool submod >/dev/null 2>&1 ) &&\n+\toutput=\"$(git mergetool --no-prompt)\" &&\n+\ttest \"$output\" = \"No files need merging\" &&\n+\tgit reset --hard\n '\n \n test_expect_success 'mergetool merges all from subdir' '\n-    (\n-\tcd subdir &&\n-\tgit config rerere.enabled false &&\n-\ttest_must_fail git merge master &&\n-\t( yes \"r\" | git mergetool ../submod ) &&\n-\t( yes \"d\" \"d\" | git mergetool --no-prompt ) &&\n-\ttest \"$(cat ../file1)\" = \"master updated\" &&\n-\ttest \"$(cat ../file2)\" = \"master new\" &&\n-\ttest \"$(cat file3)\" = \"master new sub\" &&\n-\t( cd .. && git submodule update -N ) &&\n-\ttest \"$(cat ../submod/bar)\" = \"master submodule\" &&\n-\tgit commit -m \"branch2 resolved by mergetool from subdir\"\n-    )\n+\t(\n+\t\tcd subdir &&\n+\t\tgit config rerere.enabled false &&\n+\t\ttest_must_fail git merge master &&\n+\t\t( yes \"r\" | git mergetool ../submod ) &&\n+\t\t( yes \"d\" \"d\" | git mergetool --no-prompt ) &&\n+\t\ttest \"$(cat ../file1)\" = \"master updated\" &&\n+\t\ttest \"$(cat ../file2)\" = \"master new\" &&\n+\t\ttest \"$(cat file3)\" = \"master new sub\" &&\n+\t\t( cd .. && git submodule update -N ) &&\n+\t\ttest \"$(cat ../submod/bar)\" = \"master submodule\" &&\n+\t\tgit commit -m \"branch2 resolved by mergetool from subdir\"\n+\t)\n '\n \n test_expect_success 'mergetool skips resolved paths when rerere is active' '\n-    git config rerere.enabled true &&\n-    rm -rf .git/rr-cache &&\n-    git checkout -b test5 branch1\n-    git submodule update -N &&\n-    test_must_fail git merge master >/dev/null 2>&1 &&\n-    ( yes \"l\" | git mergetool --no-prompt submod >/dev/null 2>&1 ) &&\n-    ( yes \"d\" \"d\" | git mergetool --no-prompt >/dev/null 2>&1 ) &&\n-    git submodule update -N &&\n-    output=\"$(yes \"n\" | git mergetool --no-prompt)\" &&\n-    test \"$output\" = \"No files need merging\" &&\n-    git reset --hard\n+\tgit config rerere.enabled true &&\n+\trm -rf .git/rr-cache &&\n+\tgit checkout -b test5 branch1\n+\tgit submodule update -N &&\n+\ttest_must_fail git merge master >/dev/null 2>&1 &&\n+\t( yes \"l\" | git mergetool --no-prompt submod >/dev/null 2>&1 ) &&\n+\t( yes \"d\" \"d\" | git mergetool --no-prompt >/dev/null 2>&1 ) &&\n+\tgit submodule update -N &&\n+\toutput=\"$(yes \"n\" | git mergetool --no-prompt)\" &&\n+\ttest \"$output\" = \"No files need merging\" &&\n+\tgit reset --hard\n '\n \n test_expect_success 'conflicted stash sets up rerere'  '\n-    git config rerere.enabled true &&\n-    git checkout stash1 &&\n-    echo \"Conflicting stash content\" >file11 &&\n-    git stash &&\n-\n-    git checkout --detach stash2 &&\n-    test_must_fail git stash apply &&\n-\n-    test -n \"$(git ls-files -u)\" &&\n-    conflicts=\"$(git rerere remaining)\" &&\n-    test \"$conflicts\" = \"file11\" &&\n-    output=\"$(git mergetool --no-prompt)\" &&\n-    test \"$output\" != \"No files need merging\" &&\n-\n-    git commit -am \"save the stash resolution\" &&\n-\n-    git reset --hard stash2 &&\n-    test_must_fail git stash apply &&\n-\n-    test -n \"$(git ls-files -u)\" &&\n-    conflicts=\"$(git rerere remaining)\" &&\n-    test -z \"$conflicts\" &&\n-    output=\"$(git mergetool --no-prompt)\" &&\n-    test \"$output\" = \"No files need merging\"\n+\tgit config rerere.enabled true &&\n+\tgit checkout stash1 &&\n+\techo \"Conflicting stash content\" >file11 &&\n+\tgit stash &&\n+\n+\tgit checkout --detach stash2 &&\n+\ttest_must_fail git stash apply &&\n+\n+\ttest -n \"$(git ls-files -u)\" &&\n+\tconflicts=\"$(git rerere remaining)\" &&\n+\ttest \"$conflicts\" = \"file11\" &&\n+\toutput=\"$(git mergetool --no-prompt)\" &&\n+\ttest \"$output\" != \"No files need merging\" &&\n+\n+\tgit commit -am \"save the stash resolution\" &&\n+\n+\tgit reset --hard stash2 &&\n+\ttest_must_fail git stash apply &&\n+\n+\ttest -n \"$(git ls-files -u)\" &&\n+\tconflicts=\"$(git rerere remaining)\" &&\n+\ttest -z \"$conflicts\" &&\n+\toutput=\"$(git mergetool --no-prompt)\" &&\n+\ttest \"$output\" = \"No files need merging\"\n '\n \n test_expect_success 'mergetool takes partial path' '\n-    git reset --hard\n-    git config rerere.enabled false &&\n-    git checkout -b test12 branch1 &&\n-    git submodule update -N &&\n-    test_must_fail git merge master &&\n-\n-    #should not need these lines\n-    #( yes \"d\" | git mergetool file11 >/dev/null 2>&1 ) &&\n-    #( yes \"d\" | git mergetool file12 >/dev/null 2>&1 ) &&\n-    #( yes \"l\" | git mergetool submod >/dev/null 2>&1 ) &&\n-    #( yes \"\" | git mergetool file1 file2 >/dev/null 2>&1 ) &&\n-\n-    ( yes \"\" | git mergetool subdir ) &&\n-\n-    test \"$(cat subdir/file3)\" = \"master new sub\" &&\n-    git reset --hard\n+\tgit reset --hard\n+\tgit config rerere.enabled false &&\n+\tgit checkout -b test12 branch1 &&\n+\tgit submodule update -N &&\n+\ttest_must_fail git merge master &&\n+\n+\t#should not need these lines\n+\t#( yes \"d\" | git mergetool file11 >/dev/null 2>&1 ) &&\n+\t#( yes \"d\" | git mergetool file12 >/dev/null 2>&1 ) &&\n+\t#( yes \"l\" | git mergetool submod >/dev/null 2>&1 ) &&\n+\t#( yes \"\" | git mergetool file1 file2 >/dev/null 2>&1 ) &&\n+\n+\t( yes \"\" | git mergetool subdir ) &&\n+\n+\ttest \"$(cat subdir/file3)\" = \"master new sub\" &&\n+\tgit reset --hard\n '\n \n test_expect_success 'deleted vs modified submodule' '\n-    git checkout -b test6 branch1 &&\n-    git submodule update -N &&\n-    mv submod submod-movedaside &&\n-    git rm --cached submod &&\n-    git commit -m \"Submodule deleted from branch\" &&\n-    git checkout -b test6.a test6 &&\n-    test_must_fail git merge master &&\n-    test -n \"$(git ls-files -u)\" &&\n-    ( yes \"\" | git mergetool file1 file2 spaced\\ name subdir/file3 >/dev/null 2>&1 ) &&\n-    ( yes \"\" | git mergetool both >/dev/null 2>&1 ) &&\n-    ( yes \"d\" | git mergetool file11 file12 >/dev/null 2>&1 ) &&\n-    ( yes \"r\" | git mergetool submod ) &&\n-    rmdir submod && mv submod-movedaside submod &&\n-    test \"$(cat submod/bar)\" = \"branch1 submodule\" &&\n-    git submodule update -N &&\n-    test \"$(cat submod/bar)\" = \"master submodule\" &&\n-    output=\"$(git mergetool --no-prompt)\" &&\n-    test \"$output\" = \"No files need merging\" &&\n-    git commit -m \"Merge resolved by keeping module\" &&\n-\n-    mv submod submod-movedaside &&\n-    git checkout -b test6.b test6 &&\n-    git submodule update -N &&\n-    test_must_fail git merge master &&\n-    test -n \"$(git ls-files -u)\" &&\n-    ( yes \"\" | git mergetool file1 file2 spaced\\ name subdir/file3 >/dev/null 2>&1 ) &&\n-    ( yes \"\" | git mergetool both >/dev/null 2>&1 ) &&\n-    ( yes \"d\" | git mergetool file11 file12 >/dev/null 2>&1 ) &&\n-    ( yes \"l\" | git mergetool submod ) &&\n-    test ! -e submod &&\n-    output=\"$(git mergetool --no-prompt)\" &&\n-    test \"$output\" = \"No files need merging\" &&\n-    git commit -m \"Merge resolved by deleting module\" &&\n-\n-    mv submod-movedaside submod &&\n-    git checkout -b test6.c master &&\n-    git submodule update -N &&\n-    test_must_fail git merge test6 &&\n-    test -n \"$(git ls-files -u)\" &&\n-    ( yes \"\" | git mergetool file1 file2 spaced\\ name subdir/file3 >/dev/null 2>&1 ) &&\n-    ( yes \"\" | git mergetool both >/dev/null 2>&1 ) &&\n-    ( yes \"d\" | git mergetool file11 file12 >/dev/null 2>&1 ) &&\n-    ( yes \"r\" | git mergetool submod ) &&\n-    test ! -e submod &&\n-    test -d submod.orig &&\n-    git submodule update -N &&\n-    output=\"$(git mergetool --no-prompt)\" &&\n-    test \"$output\" = \"No files need merging\" &&\n-    git commit -m \"Merge resolved by deleting module\" &&\n-    mv submod.orig submod &&\n-\n-    git checkout -b test6.d master &&\n-    git submodule update -N &&\n-    test_must_fail git merge test6 &&\n-    test -n \"$(git ls-files -u)\" &&\n-    ( yes \"\" | git mergetool file1 file2 spaced\\ name subdir/file3 >/dev/null 2>&1 ) &&\n-    ( yes \"\" | git mergetool both >/dev/null 2>&1 ) &&\n-    ( yes \"d\" | git mergetool file11 file12 >/dev/null 2>&1 ) &&\n-    ( yes \"l\" | git mergetool submod ) &&\n-    test \"$(cat submod/bar)\" = \"master submodule\" &&\n-    git submodule update -N &&\n-    test \"$(cat submod/bar)\" = \"master submodule\" &&\n-    output=\"$(git mergetool --no-prompt)\" &&\n-    test \"$output\" = \"No files need merging\" &&\n-    git commit -m \"Merge resolved by keeping module\" &&\n-    git reset --hard HEAD\n+\tgit checkout -b test6 branch1 &&\n+\tgit submodule update -N &&\n+\tmv submod submod-movedaside &&\n+\tgit rm --cached submod &&\n+\tgit commit -m \"Submodule deleted from branch\" &&\n+\tgit checkout -b test6.a test6 &&\n+\ttest_must_fail git merge master &&\n+\ttest -n \"$(git ls-files -u)\" &&\n+\t( yes \"\" | git mergetool file1 file2 spaced\\ name subdir/file3 >/dev/null 2>&1 ) &&\n+\t( yes \"\" | git mergetool both >/dev/null 2>&1 ) &&\n+\t( yes \"d\" | git mergetool file11 file12 >/dev/null 2>&1 ) &&\n+\t( yes \"r\" | git mergetool submod ) &&\n+\trmdir submod && mv submod-movedaside submod &&\n+\ttest \"$(cat submod/bar)\" = \"branch1 submodule\" &&\n+\tgit submodule update -N &&\n+\ttest \"$(cat submod/bar)\" = \"master submodule\" &&\n+\toutput=\"$(git mergetool --no-prompt)\" &&\n+\ttest \"$output\" = \"No files need merging\" &&\n+\tgit commit -m \"Merge resolved by keeping module\" &&\n+\n+\tmv submod submod-movedaside &&\n+\tgit checkout -b test6.b test6 &&\n+\tgit submodule update -N &&\n+\ttest_must_fail git merge master &&\n+\ttest -n \"$(git ls-files -u)\" &&\n+\t( yes \"\" | git mergetool file1 file2 spaced\\ name subdir/file3 >/dev/null 2>&1 ) &&\n+\t( yes \"\" | git mergetool both >/dev/null 2>&1 ) &&\n+\t( yes \"d\" | git mergetool file11 file12 >/dev/null 2>&1 ) &&\n+\t( yes \"l\" | git mergetool submod ) &&\n+\ttest ! -e submod &&\n+\toutput=\"$(git mergetool --no-prompt)\" &&\n+\ttest \"$output\" = \"No files need merging\" &&\n+\tgit commit -m \"Merge resolved by deleting module\" &&\n+\n+\tmv submod-movedaside submod &&\n+\tgit checkout -b test6.c master &&\n+\tgit submodule update -N &&\n+\ttest_must_fail git merge test6 &&\n+\ttest -n \"$(git ls-files -u)\" &&\n+\t( yes \"\" | git mergetool file1 file2 spaced\\ name subdir/file3 >/dev/null 2>&1 ) &&\n+\t( yes \"\" | git mergetool both >/dev/null 2>&1 ) &&\n+\t( yes \"d\" | git mergetool file11 file12 >/dev/null 2>&1 ) &&\n+\t( yes \"r\" | git mergetool submod ) &&\n+\ttest ! -e submod &&\n+\ttest -d submod.orig &&\n+\tgit submodule update -N &&\n+\toutput=\"$(git mergetool --no-prompt)\" &&\n+\ttest \"$output\" = \"No files need merging\" &&\n+\tgit commit -m \"Merge resolved by deleting module\" &&\n+\tmv submod.orig submod &&\n+\n+\tgit checkout -b test6.d master &&\n+\tgit submodule update -N &&\n+\ttest_must_fail git merge test6 &&\n+\ttest -n \"$(git ls-files -u)\" &&\n+\t( yes \"\" | git mergetool file1 file2 spaced\\ name subdir/file3 >/dev/null 2>&1 ) &&\n+\t( yes \"\" | git mergetool both >/dev/null 2>&1 ) &&\n+\t( yes \"d\" | git mergetool file11 file12 >/dev/null 2>&1 ) &&\n+\t( yes \"l\" | git mergetool submod ) &&\n+\ttest \"$(cat submod/bar)\" = \"master submodule\" &&\n+\tgit submodule update -N &&\n+\ttest \"$(cat submod/bar)\" = \"master submodule\" &&\n+\toutput=\"$(git mergetool --no-prompt)\" &&\n+\ttest \"$output\" = \"No files need merging\" &&\n+\tgit commit -m \"Merge resolved by keeping module\" &&\n+\tgit reset --hard HEAD\n '\n \n test_expect_success 'file vs modified submodule' '\n-    git checkout -b test7 branch1 &&\n-    git submodule update -N &&\n-    mv submod submod-movedaside &&\n-    git rm --cached submod &&\n-    echo not a submodule >submod &&\n-    git add submod &&\n-    git commit -m \"Submodule path becomes file\" &&\n-    git checkout -b test7.a branch1 &&\n-    test_must_fail git merge master &&\n-    test -n \"$(git ls-files -u)\" &&\n-    ( yes \"\" | git mergetool file1 file2 spaced\\ name subdir/file3 >/dev/null 2>&1 ) &&\n-    ( yes \"\" | git mergetool both >/dev/null 2>&1 ) &&\n-    ( yes \"d\" | git mergetool file11 file12 >/dev/null 2>&1 ) &&\n-    ( yes \"r\" | git mergetool submod ) &&\n-    rmdir submod && mv submod-movedaside submod &&\n-    test \"$(cat submod/bar)\" = \"branch1 submodule\" &&\n-    git submodule update -N &&\n-    test \"$(cat submod/bar)\" = \"master submodule\" &&\n-    output=\"$(git mergetool --no-prompt)\" &&\n-    test \"$output\" = \"No files need merging\" &&\n-    git commit -m \"Merge resolved by keeping module\" &&\n-\n-    mv submod submod-movedaside &&\n-    git checkout -b test7.b test7 &&\n-    test_must_fail git merge master &&\n-    test -n \"$(git ls-files -u)\" &&\n-    ( yes \"\" | git mergetool file1 file2 spaced\\ name subdir/file3 >/dev/null 2>&1 ) &&\n-    ( yes \"\" | git mergetool both >/dev/null 2>&1 ) &&\n-    ( yes \"d\" | git mergetool file11 file12 >/dev/null 2>&1 ) &&\n-    ( yes \"l\" | git mergetool submod ) &&\n-    git submodule update -N &&\n-    test \"$(cat submod)\" = \"not a submodule\" &&\n-    output=\"$(git mergetool --no-prompt)\" &&\n-    test \"$output\" = \"No files need merging\" &&\n-    git commit -m \"Merge resolved by keeping file\" &&\n-\n-    git checkout -b test7.c master &&\n-    rmdir submod && mv submod-movedaside submod &&\n-    test ! -e submod.orig &&\n-    git submodule update -N &&\n-    test_must_fail git merge test7 &&\n-    test -n \"$(git ls-files -u)\" &&\n-    ( yes \"\" | git mergetool file1 file2 spaced\\ name subdir/file3 >/dev/null 2>&1 ) &&\n-    ( yes \"\" | git mergetool both >/dev/null 2>&1 ) &&\n-    ( yes \"d\" | git mergetool file11 file12 >/dev/null 2>&1 ) &&\n-    ( yes \"r\" | git mergetool submod ) &&\n-    test -d submod.orig &&\n-    git submodule update -N &&\n-    test \"$(cat submod)\" = \"not a submodule\" &&\n-    output=\"$(git mergetool --no-prompt)\" &&\n-    test \"$output\" = \"No files need merging\" &&\n-    git commit -m \"Merge resolved by keeping file\" &&\n-\n-    git checkout -b test7.d master &&\n-    rmdir submod && mv submod.orig submod &&\n-    git submodule update -N &&\n-    test_must_fail git merge test7 &&\n-    test -n \"$(git ls-files -u)\" &&\n-    ( yes \"\" | git mergetool file1 file2 spaced\\ name subdir/file3 >/dev/null 2>&1 ) &&\n-    ( yes \"\" | git mergetool both>/dev/null 2>&1 ) &&\n-    ( yes \"d\" | git mergetool file11 file12 >/dev/null 2>&1 ) &&\n-    ( yes \"l\" | git mergetool submod ) &&\n-    test \"$(cat submod/bar)\" = \"master submodule\" &&\n-    git submodule update -N &&\n-    test \"$(cat submod/bar)\" = \"master submodule\" &&\n-    output=\"$(git mergetool --no-prompt)\" &&\n-    test \"$output\" = \"No files need merging\" &&\n-    git commit -m \"Merge resolved by keeping module\"\n+\tgit checkout -b test7 branch1 &&\n+\tgit submodule update -N &&\n+\tmv submod submod-movedaside &&\n+\tgit rm --cached submod &&\n+\techo not a submodule >submod &&\n+\tgit add submod &&\n+\tgit commit -m \"Submodule path becomes file\" &&\n+\tgit checkout -b test7.a branch1 &&\n+\ttest_must_fail git merge master &&\n+\ttest -n \"$(git ls-files -u)\" &&\n+\t( yes \"\" | git mergetool file1 file2 spaced\\ name subdir/file3 >/dev/null 2>&1 ) &&\n+\t( yes \"\" | git mergetool both >/dev/null 2>&1 ) &&\n+\t( yes \"d\" | git mergetool file11 file12 >/dev/null 2>&1 ) &&\n+\t( yes \"r\" | git mergetool submod ) &&\n+\trmdir submod && mv submod-movedaside submod &&\n+\ttest \"$(cat submod/bar)\" = \"branch1 submodule\" &&\n+\tgit submodule update -N &&\n+\ttest \"$(cat submod/bar)\" = \"master submodule\" &&\n+\toutput=\"$(git mergetool --no-prompt)\" &&\n+\ttest \"$output\" = \"No files need merging\" &&\n+\tgit commit -m \"Merge resolved by keeping module\" &&\n+\n+\tmv submod submod-movedaside &&\n+\tgit checkout -b test7.b test7 &&\n+\ttest_must_fail git merge master &&\n+\ttest -n \"$(git ls-files -u)\" &&\n+\t( yes \"\" | git mergetool file1 file2 spaced\\ name subdir/file3 >/dev/null 2>&1 ) &&\n+\t( yes \"\" | git mergetool both >/dev/null 2>&1 ) &&\n+\t( yes \"d\" | git mergetool file11 file12 >/dev/null 2>&1 ) &&\n+\t( yes \"l\" | git mergetool submod ) &&\n+\tgit submodule update -N &&\n+\ttest \"$(cat submod)\" = \"not a submodule\" &&\n+\toutput=\"$(git mergetool --no-prompt)\" &&\n+\ttest \"$output\" = \"No files need merging\" &&\n+\tgit commit -m \"Merge resolved by keeping file\" &&\n+\n+\tgit checkout -b test7.c master &&\n+\trmdir submod && mv submod-movedaside submod &&\n+\ttest ! -e submod.orig &&\n+\tgit submodule update -N &&\n+\ttest_must_fail git merge test7 &&\n+\ttest -n \"$(git ls-files -u)\" &&\n+\t( yes \"\" | git mergetool file1 file2 spaced\\ name subdir/file3 >/dev/null 2>&1 ) &&\n+\t( yes \"\" | git mergetool both >/dev/null 2>&1 ) &&\n+\t( yes \"d\" | git mergetool file11 file12 >/dev/null 2>&1 ) &&\n+\t( yes \"r\" | git mergetool submod ) &&\n+\ttest -d submod.orig &&\n+\tgit submodule update -N &&\n+\ttest \"$(cat submod)\" = \"not a submodule\" &&\n+\toutput=\"$(git mergetool --no-prompt)\" &&\n+\ttest \"$output\" = \"No files need merging\" &&\n+\tgit commit -m \"Merge resolved by keeping file\" &&\n+\n+\tgit checkout -b test7.d master &&\n+\trmdir submod && mv submod.orig submod &&\n+\tgit submodule update -N &&\n+\ttest_must_fail git merge test7 &&\n+\ttest -n \"$(git ls-files -u)\" &&\n+\t( yes \"\" | git mergetool file1 file2 spaced\\ name subdir/file3 >/dev/null 2>&1 ) &&\n+\t( yes \"\" | git mergetool both>/dev/null 2>&1 ) &&\n+\t( yes \"d\" | git mergetool file11 file12 >/dev/null 2>&1 ) &&\n+\t( yes \"l\" | git mergetool submod ) &&\n+\ttest \"$(cat submod/bar)\" = \"master submodule\" &&\n+\tgit submodule update -N &&\n+\ttest \"$(cat submod/bar)\" = \"master submodule\" &&\n+\toutput=\"$(git mergetool --no-prompt)\" &&\n+\ttest \"$output\" = \"No files need merging\" &&\n+\tgit commit -m \"Merge resolved by keeping module\"\n '\n \n test_expect_success 'submodule in subdirectory' '\n-    git checkout -b test10 branch1 &&\n-    git submodule update -N &&\n-    (\n-\tcd subdir &&\n-\ttest_create_repo subdir_module &&\n+\tgit checkout -b test10 branch1 &&\n+\tgit submodule update -N &&\n+\t(\n+\t\tcd subdir &&\n+\t\ttest_create_repo subdir_module &&\n+\t\t(\n+\t\tcd subdir_module &&\n+\t\t: >file15 &&\n+\t\tgit add file15 &&\n+\t\tgit commit -m \"add initial versions\"\n+\t\t)\n+\t) &&\n+\tgit submodule add git://example.com/subsubmodule subdir/subdir_module &&\n+\tgit add subdir/subdir_module &&\n+\tgit commit -m \"add submodule in subdirectory\" &&\n+\n+\tgit checkout -b test10.a test10 &&\n+\tgit submodule update -N &&\n \t(\n-\t    cd subdir_module &&\n-\t    : >file15 &&\n-\t    git add file15 &&\n-\t    git commit -m \"add initial versions\"\n-\t)\n-    ) &&\n-    git submodule add git://example.com/subsubmodule subdir/subdir_module &&\n-    git add subdir/subdir_module &&\n-    git commit -m \"add submodule in subdirectory\" &&\n-\n-    git checkout -b test10.a test10 &&\n-    git submodule update -N &&\n-    (\n-\tcd subdir/subdir_module &&\n-\tgit checkout -b super10.a &&\n-\techo test10.a >file15 &&\n-\tgit add file15 &&\n-\tgit commit -m \"on branch 10.a\"\n-    ) &&\n-    git add subdir/subdir_module &&\n-    git commit -m \"change submodule in subdirectory on test10.a\" &&\n-\n-    git checkout -b test10.b test10 &&\n-    git submodule update -N &&\n-    (\n \tcd subdir/subdir_module &&\n-\tgit checkout -b super10.b &&\n-\techo test10.b >file15 &&\n-\tgit add file15 &&\n-\tgit commit -m \"on branch 10.b\"\n-    ) &&\n-    git add subdir/subdir_module &&\n-    git commit -m \"change submodule in subdirectory on test10.b\" &&\n-\n-    test_must_fail git merge test10.a >/dev/null 2>&1 &&\n-    (\n-\tcd subdir &&\n-\t( yes \"l\" | git mergetool subdir_module )\n-    ) &&\n-    test \"$(cat subdir/subdir_module/file15)\" = \"test10.b\" &&\n-    git submodule update -N &&\n-    test \"$(cat subdir/subdir_module/file15)\" = \"test10.b\" &&\n-    git reset --hard &&\n-    git submodule update -N &&\n-\n-    test_must_fail git merge test10.a >/dev/null 2>&1 &&\n-    ( yes \"r\" | git mergetool subdir/subdir_module ) &&\n-    test \"$(cat subdir/subdir_module/file15)\" = \"test10.b\" &&\n-    git submodule update -N &&\n-    test \"$(cat subdir/subdir_module/file15)\" = \"test10.a\" &&\n-    git commit -m \"branch1 resolved with mergetool\" &&\n-    rm -rf subdir/subdir_module\n+\t\tgit checkout -b super10.a &&\n+\t\techo test10.a >file15 &&\n+\t\tgit add file15 &&\n+\t\tgit commit -m \"on branch 10.a\"\n+\t) &&\n+\tgit add subdir/subdir_module &&\n+\tgit commit -m \"change submodule in subdirectory on test10.a\" &&\n+\n+\tgit checkout -b test10.b test10 &&\n+\tgit submodule update -N &&\n+\t(\n+\t\tcd subdir/subdir_module &&\n+\t\tgit checkout -b super10.b &&\n+\t\techo test10.b >file15 &&\n+\t\tgit add file15 &&\n+\t\tgit commit -m \"on branch 10.b\"\n+\t) &&\n+\tgit add subdir/subdir_module &&\n+\tgit commit -m \"change submodule in subdirectory on test10.b\" &&\n+\n+\ttest_must_fail git merge test10.a >/dev/null 2>&1 &&\n+\t(\n+\t\tcd subdir &&\n+\t\t( yes \"l\" | git mergetool subdir_module )\n+\t) &&\n+\ttest \"$(cat subdir/subdir_module/file15)\" = \"test10.b\" &&\n+\tgit submodule update -N &&\n+\ttest \"$(cat subdir/subdir_module/file15)\" = \"test10.b\" &&\n+\tgit reset --hard &&\n+\tgit submodule update -N &&\n+\n+\ttest_must_fail git merge test10.a >/dev/null 2>&1 &&\n+\t( yes \"r\" | git mergetool subdir/subdir_module ) &&\n+\ttest \"$(cat subdir/subdir_module/file15)\" = \"test10.b\" &&\n+\tgit submodule update -N &&\n+\ttest \"$(cat subdir/subdir_module/file15)\" = \"test10.a\" &&\n+\tgit commit -m \"branch1 resolved with mergetool\" &&\n+\trm -rf subdir/subdir_module\n '\n \n test_expect_success 'directory vs modified submodule' '\n-    git checkout -b test11 branch1 &&\n-    mv submod submod-movedaside &&\n-    git rm --cached submod &&\n-    mkdir submod &&\n-    echo not a submodule >submod/file16 &&\n-    git add submod/file16 &&\n-    git commit -m \"Submodule path becomes directory\" &&\n-\n-    test_must_fail git merge master &&\n-    test -n \"$(git ls-files -u)\" &&\n-    ( yes \"l\" | git mergetool submod ) &&\n-    test \"$(cat submod/file16)\" = \"not a submodule\" &&\n-    rm -rf submod.orig &&\n-\n-    git reset --hard >/dev/null 2>&1 &&\n-    test_must_fail git merge master &&\n-    test -n \"$(git ls-files -u)\" &&\n-    test ! -e submod.orig &&\n-    ( yes \"r\" | git mergetool submod ) &&\n-    test -d submod.orig &&\n-    test \"$(cat submod.orig/file16)\" = \"not a submodule\" &&\n-    rm -r submod.orig &&\n-    mv submod-movedaside/.git submod &&\n-    ( cd submod && git clean -f && git reset --hard ) &&\n-    git submodule update -N &&\n-    test \"$(cat submod/bar)\" = \"master submodule\" &&\n-    git reset --hard >/dev/null 2>&1 && rm -rf submod-movedaside &&\n-\n-    git checkout -b test11.c master &&\n-    git submodule update -N &&\n-    test_must_fail git merge test11 &&\n-    test -n \"$(git ls-files -u)\" &&\n-    ( yes \"l\" | git mergetool submod ) &&\n-    git submodule update -N &&\n-    test \"$(cat submod/bar)\" = \"master submodule\" &&\n-\n-    git reset --hard >/dev/null 2>&1 &&\n-    git submodule update -N &&\n-    test_must_fail git merge test11 &&\n-    test -n \"$(git ls-files -u)\" &&\n-    test ! -e submod.orig &&\n-    ( yes \"r\" | git mergetool submod ) &&\n-    test \"$(cat submod/file16)\" = \"not a submodule\" &&\n-\n-    git reset --hard master >/dev/null 2>&1 &&\n-    ( cd submod && git clean -f && git reset --hard ) &&\n-    git submodule update -N\n+\tgit checkout -b test11 branch1 &&\n+\tmv submod submod-movedaside &&\n+\tgit rm --cached submod &&\n+\tmkdir submod &&\n+\techo not a submodule >submod/file16 &&\n+\tgit add submod/file16 &&\n+\tgit commit -m \"Submodule path becomes directory\" &&\n+\n+\ttest_must_fail git merge master &&\n+\ttest -n \"$(git ls-files -u)\" &&\n+\t( yes \"l\" | git mergetool submod ) &&\n+\ttest \"$(cat submod/file16)\" = \"not a submodule\" &&\n+\trm -rf submod.orig &&\n+\n+\tgit reset --hard >/dev/null 2>&1 &&\n+\ttest_must_fail git merge master &&\n+\ttest -n \"$(git ls-files -u)\" &&\n+\ttest ! -e submod.orig &&\n+\t( yes \"r\" | git mergetool submod ) &&\n+\ttest -d submod.orig &&\n+\ttest \"$(cat submod.orig/file16)\" = \"not a submodule\" &&\n+\trm -r submod.orig &&\n+\tmv submod-movedaside/.git submod &&\n+\t( cd submod && git clean -f && git reset --hard ) &&\n+\tgit submodule update -N &&\n+\ttest \"$(cat submod/bar)\" = \"master submodule\" &&\n+\tgit reset --hard >/dev/null 2>&1 && rm -rf submod-movedaside &&\n+\n+\tgit checkout -b test11.c master &&\n+\tgit submodule update -N &&\n+\ttest_must_fail git merge test11 &&\n+\ttest -n \"$(git ls-files -u)\" &&\n+\t( yes \"l\" | git mergetool submod ) &&\n+\tgit submodule update -N &&\n+\ttest \"$(cat submod/bar)\" = \"master submodule\" &&\n+\n+\tgit reset --hard >/dev/null 2>&1 &&\n+\tgit submodule update -N &&\n+\ttest_must_fail git merge test11 &&\n+\ttest -n \"$(git ls-files -u)\" &&\n+\ttest ! -e submod.orig &&\n+\t( yes \"r\" | git mergetool submod ) &&\n+\ttest \"$(cat submod/file16)\" = \"not a submodule\" &&\n+\n+\tgit reset --hard master >/dev/null 2>&1 &&\n+\t( cd submod && git clean -f && git reset --hard ) &&\n+\tgit submodule update -N\n '\n \n test_expect_success 'file with no base' '\n-    git checkout -b test13 branch1 &&\n-    test_must_fail git merge master &&\n-    git mergetool --no-prompt --tool mybase -- both &&\n-    >expected &&\n-    test_cmp both expected &&\n-    git reset --hard master >/dev/null 2>&1\n+\tgit checkout -b test13 branch1 &&\n+\ttest_must_fail git merge master &&\n+\tgit mergetool --no-prompt --tool mybase -- both &&\n+\t>expected &&\n+\ttest_cmp both expected &&\n+\tgit reset --hard master >/dev/null 2>&1\n '\n \n test_expect_success 'custom commands override built-ins' '\n-    git checkout -b test14 branch1 &&\n-    git config mergetool.defaults.cmd \"cat \\\"\\$REMOTE\\\" >\\\"\\$MERGED\\\"\" &&\n-    git config mergetool.defaults.trustExitCode true &&\n-    test_must_fail git merge master &&\n-    git mergetool --no-prompt --tool defaults -- both &&\n-    echo master both added >expected &&\n-    test_cmp both expected &&\n-    git config --unset mergetool.defaults.cmd &&\n-    git config --unset mergetool.defaults.trustExitCode &&\n-    git reset --hard master >/dev/null 2>&1\n+\tgit checkout -b test14 branch1 &&\n+\tgit config mergetool.defaults.cmd \"cat \\\"\\$REMOTE\\\" >\\\"\\$MERGED\\\"\" &&\n+\tgit config mergetool.defaults.trustExitCode true &&\n+\ttest_must_fail git merge master &&\n+\tgit mergetool --no-prompt --tool defaults -- both &&\n+\techo master both added >expected &&\n+\ttest_cmp both expected &&\n+\tgit config --unset mergetool.defaults.cmd &&\n+\tgit config --unset mergetool.defaults.trustExitCode &&\n+\tgit reset --hard master >/dev/null 2>&1\n '\n \n test_done\n-- \n2.1.2.453.g1b015e3\n"},{"id":"250669","messageId":"1413362121-17361-2-git-send-email-davvid@gmail.com","threadId":"37733","inReplyTo":"1413362121-17361-1-git-send-email-davvid@gmail.com","subject":"[PATCH 2/5] t7610-mergetool: add missing && and remove commented-out code","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2014-10-15T08:35:18Z","receivedAt":"2014-10-15T08:35:18Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"Signed-off-by: David Aguilar <davvid@gmail.com>\n---\n t/t7610-mergetool.sh | 10 ++--------\n 1 file changed, 2 insertions(+), 8 deletions(-)\n\ndiff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh\nindex 875c8af..214edfb 100755\n--- a/t/t7610-mergetool.sh\n+++ b/t/t7610-mergetool.sh\n@@ -192,7 +192,7 @@ test_expect_success 'mergetool merges all from subdir' '\n test_expect_success 'mergetool skips resolved paths when rerere is active' '\n \tgit config rerere.enabled true &&\n \trm -rf .git/rr-cache &&\n-\tgit checkout -b test5 branch1\n+\tgit checkout -b test5 branch1 &&\n \tgit submodule update -N &&\n \ttest_must_fail git merge master >/dev/null 2>&1 &&\n \t( yes \"l\" | git mergetool --no-prompt submod >/dev/null 2>&1 ) &&\n@@ -231,18 +231,12 @@ test_expect_success 'conflicted stash sets up rerere'  '\n '\n \n test_expect_success 'mergetool takes partial path' '\n-\tgit reset --hard\n+\tgit reset --hard &&\n \tgit config rerere.enabled false &&\n \tgit checkout -b test12 branch1 &&\n \tgit submodule update -N &&\n \ttest_must_fail git merge master &&\n \n-\t#should not need these lines\n-\t#( yes \"d\" | git mergetool file11 >/dev/null 2>&1 ) &&\n-\t#( yes \"d\" | git mergetool file12 >/dev/null 2>&1 ) &&\n-\t#( yes \"l\" | git mergetool submod >/dev/null 2>&1 ) &&\n-\t#( yes \"\" | git mergetool file1 file2 >/dev/null 2>&1 ) &&\n-\n \t( yes \"\" | git mergetool subdir ) &&\n \n \ttest \"$(cat subdir/file3)\" = \"master new sub\" &&\n-- \n2.1.2.453.g1b015e3\n"},{"id":"250672","messageId":"1413362121-17361-3-git-send-email-davvid@gmail.com","threadId":"37733","inReplyTo":"1413362121-17361-2-git-send-email-davvid@gmail.com","subject":"[PATCH 3/5] t7610-mergetool: add test cases for mergetool.writeToTemp","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2014-10-15T08:35:19Z","receivedAt":"2014-10-15T08:35:19Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"Add tests to ensure that filenames start with \"./\" when\nmergetool.writeToTemp is false and do not start with \"./\" when\nmergetool.writeToTemp is true.\n\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\n t/t7610-mergetool.sh | 23 +++++++++++++++++++++++\n 1 file changed, 23 insertions(+)\n\ndiff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh\nindex 214edfb..1a15e06 100755\n--- a/t/t7610-mergetool.sh\n+++ b/t/t7610-mergetool.sh\n@@ -516,4 +516,27 @@ test_expect_success 'custom commands override built-ins' '\n \tgit reset --hard master >/dev/null 2>&1\n '\n \n+test_expect_success 'filenames seen by tools start with ./' '\n+\tgit checkout -b test15 branch1 &&\n+\ttest_config mergetool.writeToTemp false &&\n+\ttest_config mergetool.myecho.cmd \"echo \\\"\\$LOCAL\\\"\" &&\n+\ttest_config mergetool.myecho.trustExitCode true &&\n+\ttest_must_fail git merge master &&\n+\tgit mergetool --no-prompt --tool myecho -- both >actual &&\n+\tgrep ^\\./both_LOCAL_ actual >/dev/null &&\n+\tgit reset --hard master >/dev/null 2>&1\n+'\n+\n+test_expect_success 'temporary filenames are used with mergetool.writeToTemp' '\n+\tgit checkout -b test16 branch1 &&\n+\ttest_config mergetool.writeToTemp true &&\n+\ttest_config mergetool.myecho.cmd \"echo \\\"\\$LOCAL\\\"\" &&\n+\ttest_config mergetool.myecho.trustExitCode true &&\n+\ttest_must_fail git merge master &&\n+\tgit mergetool --no-prompt --tool myecho -- both >actual &&\n+\ttest_must_fail grep ^\\./both_LOCAL_ actual >/dev/null &&\n+\tgrep /both_LOCAL_ actual >/dev/null &&\n+\tgit reset --hard master >/dev/null 2>&1\n+'\n+\n test_done\n-- \n2.1.2.453.g1b015e3\n"},{"id":"250668","messageId":"1413362121-17361-4-git-send-email-davvid@gmail.com","threadId":"37733","inReplyTo":"1413362121-17361-3-git-send-email-davvid@gmail.com","subject":"[PATCH 4/5] t7610-mergetool: prefer test_config over git config","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2014-10-15T08:35:20Z","receivedAt":"2014-10-15T08:35:20Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"Signed-off-by: David Aguilar <davvid@gmail.com>\n---\n t/t7610-mergetool.sh | 20 +++++++++-----------\n 1 file changed, 9 insertions(+), 11 deletions(-)\n\ndiff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh\nindex 1a15e06..7eeb207 100755\n--- a/t/t7610-mergetool.sh\n+++ b/t/t7610-mergetool.sh\n@@ -14,7 +14,7 @@ Testing basic merge tool invocation'\n # running mergetool\n \n test_expect_success 'setup' '\n-\tgit config rerere.enabled true &&\n+\ttest_config rerere.enabled true &&\n \techo master >file1 &&\n \techo master spaced >\"spaced name\" &&\n \techo master file11 >file11 &&\n@@ -112,7 +112,7 @@ test_expect_success 'custom mergetool' '\n '\n \n test_expect_success 'mergetool crlf' '\n-\tgit config core.autocrlf true &&\n+\ttest_config core.autocrlf true &&\n \tgit checkout -b test2 branch1 &&\n \ttest_must_fail git merge master >/dev/null 2>&1 &&\n \t( yes \"\" | git mergetool file1 >/dev/null 2>&1 ) &&\n@@ -129,7 +129,7 @@ test_expect_success 'mergetool crlf' '\n \tgit submodule update -N &&\n \ttest \"$(cat submod/bar)\" = \"master submodule\" &&\n \tgit commit -m \"branch1 resolved with mergetool - autocrlf\" &&\n-\tgit config core.autocrlf false &&\n+\ttest_config core.autocrlf false &&\n \tgit reset --hard\n '\n \n@@ -176,7 +176,7 @@ test_expect_success 'mergetool skips autoresolved' '\n test_expect_success 'mergetool merges all from subdir' '\n \t(\n \t\tcd subdir &&\n-\t\tgit config rerere.enabled false &&\n+\t\ttest_config rerere.enabled false &&\n \t\ttest_must_fail git merge master &&\n \t\t( yes \"r\" | git mergetool ../submod ) &&\n \t\t( yes \"d\" \"d\" | git mergetool --no-prompt ) &&\n@@ -190,7 +190,7 @@ test_expect_success 'mergetool merges all from subdir' '\n '\n \n test_expect_success 'mergetool skips resolved paths when rerere is active' '\n-\tgit config rerere.enabled true &&\n+\ttest_config rerere.enabled true &&\n \trm -rf .git/rr-cache &&\n \tgit checkout -b test5 branch1 &&\n \tgit submodule update -N &&\n@@ -204,7 +204,7 @@ test_expect_success 'mergetool skips resolved paths when rerere is active' '\n '\n \n test_expect_success 'conflicted stash sets up rerere'  '\n-\tgit config rerere.enabled true &&\n+\ttest_config rerere.enabled true &&\n \tgit checkout stash1 &&\n \techo \"Conflicting stash content\" >file11 &&\n \tgit stash &&\n@@ -232,7 +232,7 @@ test_expect_success 'conflicted stash sets up rerere'  '\n \n test_expect_success 'mergetool takes partial path' '\n \tgit reset --hard &&\n-\tgit config rerere.enabled false &&\n+\ttest_config rerere.enabled false &&\n \tgit checkout -b test12 branch1 &&\n \tgit submodule update -N &&\n \ttest_must_fail git merge master &&\n@@ -505,14 +505,12 @@ test_expect_success 'file with no base' '\n \n test_expect_success 'custom commands override built-ins' '\n \tgit checkout -b test14 branch1 &&\n-\tgit config mergetool.defaults.cmd \"cat \\\"\\$REMOTE\\\" >\\\"\\$MERGED\\\"\" &&\n-\tgit config mergetool.defaults.trustExitCode true &&\n+\ttest_config mergetool.defaults.cmd \"cat \\\"\\$REMOTE\\\" >\\\"\\$MERGED\\\"\" &&\n+\ttest_config mergetool.defaults.trustExitCode true &&\n \ttest_must_fail git merge master &&\n \tgit mergetool --no-prompt --tool defaults -- both &&\n \techo master both added >expected &&\n \ttest_cmp both expected &&\n-\tgit config --unset mergetool.defaults.cmd &&\n-\tgit config --unset mergetool.defaults.trustExitCode &&\n \tgit reset --hard master >/dev/null 2>&1\n '\n \n-- \n2.1.2.453.g1b015e3\n"},{"id":"250670","messageId":"1413362121-17361-5-git-send-email-davvid@gmail.com","threadId":"37733","inReplyTo":"1413362121-17361-4-git-send-email-davvid@gmail.com","subject":"[PATCH 5/5] test-lib-functions: adjust style to match CodingGuidelines","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2014-10-15T08:35:21Z","receivedAt":"2014-10-15T08:35:21Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"Prefer \"test\" over \"[ ]\" for conditionals.\nPrefer \"$()\" over backticks for command substitutions.\nAvoid control structures on a single line with semicolons.\n\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\n t/test-lib-functions.sh | 30 ++++++++++++++++++------------\n 1 file changed, 18 insertions(+), 12 deletions(-)\n\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex dafd6ad..fc77cc6 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -413,7 +413,7 @@ test_external () {\n \t\t# test_run_, but keep its stdout on our stdout even in\n \t\t# non-verbose mode.\n \t\t\"$@\" 2>&4\n-\t\tif [ \"$?\" = 0 ]\n+\t\tif test \"$?\" = 0\n \t\tthen\n \t\t\tif test $test_external_has_tap -eq 0; then\n \t\t\t\ttest_ok_ \"$descr\"\n@@ -440,11 +440,12 @@ test_external_without_stderr () {\n \ttmp=${TMPDIR:-/tmp}\n \tstderr=\"$tmp/git-external-stderr.$$.tmp\"\n \ttest_external \"$@\" 4> \"$stderr\"\n-\t[ -f \"$stderr\" ] || error \"Internal error: $stderr disappeared.\"\n+\ttest -f \"$stderr\" || error \"Internal error: $stderr disappeared.\"\n \tdescr=\"no stderr: $1\"\n \tshift\n \tsay >&3 \"# expecting no stderr from previous command\"\n-\tif [ ! -s \"$stderr\" ]; then\n+\tif test ! -s \"$stderr\"\n+\tthen\n \t\trm \"$stderr\"\n \n \t\tif test $test_external_has_tap -eq 0; then\n@@ -454,8 +455,9 @@ test_external_without_stderr () {\n \t\t\ttest_success=$(($test_success + 1))\n \t\tfi\n \telse\n-\t\tif [ \"$verbose\" = t ]; then\n-\t\t\toutput=`echo; echo \"# Stderr is:\"; cat \"$stderr\"`\n+\t\tif test \"$verbose\" = t\n+\t\tthen\n+\t\t\toutput=$(echo; echo \"# Stderr is:\"; cat \"$stderr\")\n \t\telse\n \t\t\toutput=\n \t\tfi\n@@ -474,7 +476,7 @@ test_external_without_stderr () {\n # The commands test the existence or non-existence of $1. $2 can be\n # given to provide a more precise diagnosis.\n test_path_is_file () {\n-\tif ! [ -f \"$1\" ]\n+\tif ! test -f \"$1\"\n \tthen\n \t\techo \"File $1 doesn't exist. $*\"\n \t\tfalse\n@@ -482,7 +484,7 @@ test_path_is_file () {\n }\n \n test_path_is_dir () {\n-\tif ! [ -d \"$1\" ]\n+\tif ! test -d \"$1\"\n \tthen\n \t\techo \"Directory $1 doesn't exist. $*\"\n \t\tfalse\n@@ -501,11 +503,12 @@ test_dir_is_empty () {\n }\n \n test_path_is_missing () {\n-\tif [ -e \"$1\" ]\n+\tif test -e \"$1\"\n \tthen\n \t\techo \"Path exists:\"\n \t\tls -ld \"$1\"\n-\t\tif [ $# -ge 1 ]; then\n+\t\tif test $# -ge 1\n+\t\tthen\n \t\t\techo \"$*\"\n \t\tfi\n \t\tfalse\n@@ -657,9 +660,12 @@ test_cmp_rev () {\n # similar to GNU seq(1), but the latter might not be available\n # everywhere (and does not do letters).  It may be used like:\n #\n-#\tfor i in `test_seq 100`; do\n-#\t\tfor j in `test_seq 10 20`; do\n-#\t\t\tfor k in `test_seq a z`; do\n+#\tfor i in $(test_seq 100)\n+#\tdo\n+#\t\tfor j in $(test_seq 10 20)\n+#\t\tdo\n+#\t\t\tfor k in $(test_seq a z)\n+#\t\t\tdo\n #\t\t\t\techo $i-$j-$k\n #\t\t\tdone\n #\t\tdone\n-- \n2.1.2.453.g1b015e3\n"},{"id":"250706","messageId":"xmqqwq81ujlw.fsf@gitster.dls.corp.google.com","threadId":"37733","inReplyTo":"1413362121-17361-4-git-send-email-davvid@gmail.com","subject":"Re: [PATCH 4/5] t7610-mergetool: prefer test_config over git config","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-10-15T21:08:11Z","receivedAt":"2014-10-15T21:08:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Aguilar <davvid@gmail.com> writes:\n\n> Signed-off-by: David Aguilar <davvid@gmail.com>\n> ---\n\nThe reason why this change favours \"test_config\" over \"git config\"\nis not described here, but if we think about that, some of the\nchanges in this may become questionable.\n\n> diff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh\n> index 1a15e06..7eeb207 100755\n> --- a/t/t7610-mergetool.sh\n> +++ b/t/t7610-mergetool.sh\n> @@ -14,7 +14,7 @@ Testing basic merge tool invocation'\n>  # running mergetool\n>  \n>  test_expect_success 'setup' '\n> -\tgit config rerere.enabled true &&\n> +\ttest_config rerere.enabled true &&\n>  \techo master >file1 &&\n>  \techo master spaced >\"spaced name\" &&\n>  \techo master file11 >file11 &&\n\nThis one does not have corresponding \"git config\" to remove the\nconfiguration when the setup is done, so this changes the\nbehaviour.  The remainder of the tests will run without\nrerere.enabled set.\n\nIf this change does not make a difference, perhaps we do not even\nneed to set rerere.enabled here in the first place?\n\nBut do later tests perform merges that can potentially be affected\nby the setting of rerere.enabled?  If so, this change can break\nthem.  If this change does not break existing tests, I would say\nthis is a good change that anticipates that we may add more tests in\nthe future that work in subdir and that makes sure to leave subdir\nin a predictable state for them.\n\n> @@ -112,7 +112,7 @@ test_expect_success 'custom mergetool' '\n>  '\n>  \n>  test_expect_success 'mergetool crlf' '\n> -\tgit config core.autocrlf true &&\n> +\ttest_config core.autocrlf true &&\n>  \tgit checkout -b test2 branch1 &&\n>  \ttest_must_fail git merge master >/dev/null 2>&1 &&\n>  \t( yes \"\" | git mergetool file1 >/dev/null 2>&1 ) &&\n> @@ -129,7 +129,7 @@ test_expect_success 'mergetool crlf' '\n>  \tgit submodule update -N &&\n>  \ttest \"$(cat submod/bar)\" = \"master submodule\" &&\n>  \tgit commit -m \"branch1 resolved with mergetool - autocrlf\" &&\n> -\tgit config core.autocrlf false &&\n> +\ttest_config core.autocrlf false &&\n>  \tgit reset --hard\n>  '\n\nThis one wants to set core.autocrlf to true while it runs, and then\nwants to reset to the original.  When the test fails in the middle,\nhowever, we may abort this test and move on to the next one, while\nleaving core.autcrlf still set to \"true\", which may break later\ntests, hence use of test_config to ensure that the setting is\nreverted at the end of the test is the right thing to do.\n\nSo the hunk #112 is correct, but the hunk #129 is questionable and\neven misleading.\n\n> @@ -176,7 +176,7 @@ test_expect_success 'mergetool skips autoresolved' '\n>  test_expect_success 'mergetool merges all from subdir' '\n>  \t(\n>  \t\tcd subdir &&\n> -\t\tgit config rerere.enabled false &&\n> +\t\ttest_config rerere.enabled false &&\n>  \t\ttest_must_fail git merge master &&\n>  \t\t( yes \"r\" | git mergetool ../submod ) &&\n>  \t\t( yes \"d\" \"d\" | git mergetool --no-prompt ) &&\n\nSame comment as the one for hunk #14 applies here.  In principle,\nthis change will make this test more isolated and is a good thing.\n\n> @@ -190,7 +190,7 @@ test_expect_success 'mergetool merges all from subdir' '\n>  '\n>  \n>  test_expect_success 'mergetool skips resolved paths when rerere is active' '\n> -\tgit config rerere.enabled true &&\n> +\ttest_config rerere.enabled true &&\n>  \trm -rf .git/rr-cache &&\n>  \tgit checkout -b test5 branch1 &&\n>  \tgit submodule update -N &&\n\nDitto.\n\n> @@ -204,7 +204,7 @@ test_expect_success 'mergetool skips resolved paths when rerere is active' '\n>  '\n>  \n>  test_expect_success 'conflicted stash sets up rerere'  '\n> -\tgit config rerere.enabled true &&\n> +\ttest_config rerere.enabled true &&\n>  \tgit checkout stash1 &&\n>  \techo \"Conflicting stash content\" >file11 &&\n>  \tgit stash &&\n\nDitto.\n\n> @@ -232,7 +232,7 @@ test_expect_success 'conflicted stash sets up rerere'  '\n>  \n>  test_expect_success 'mergetool takes partial path' '\n>  \tgit reset --hard &&\n> -\tgit config rerere.enabled false &&\n> +\ttest_config rerere.enabled false &&\n>  \tgit checkout -b test12 branch1 &&\n>  \tgit submodule update -N &&\n>  \ttest_must_fail git merge master &&\n\nDitto.\n\n> @@ -505,14 +505,12 @@ test_expect_success 'file with no base' '\n>  \n>  test_expect_success 'custom commands override built-ins' '\n>  \tgit checkout -b test14 branch1 &&\n> -\tgit config mergetool.defaults.cmd \"cat \\\"\\$REMOTE\\\" >\\\"\\$MERGED\\\"\" &&\n> -\tgit config mergetool.defaults.trustExitCode true &&\n> +\ttest_config mergetool.defaults.cmd \"cat \\\"\\$REMOTE\\\" >\\\"\\$MERGED\\\"\" &&\n> +\ttest_config mergetool.defaults.trustExitCode true &&\n>  \ttest_must_fail git merge master &&\n>  \tgit mergetool --no-prompt --tool defaults -- both &&\n>  \techo master both added >expected &&\n>  \ttest_cmp both expected &&\n> -\tgit config --unset mergetool.defaults.cmd &&\n> -\tgit config --unset mergetool.defaults.trustExitCode &&\n>  \tgit reset --hard master >/dev/null 2>&1\n>  '\n\nThis one is good; with test_config, you do not have to do the\nunsetting yourself.\n"},{"id":"250744","messageId":"1413437404-23810-1-git-send-email-davvid@gmail.com","threadId":"37733","inReplyTo":"xmqqwq81ujlw.fsf@gitster.dls.corp.google.com","subject":"[PATCH v2 4/5] t7610-mergetool: use test_config to isolate tests","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2014-10-16T05:30:04Z","receivedAt":"2014-10-16T05:30:04Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"Signed-off-by: David Aguilar <davvid@gmail.com>\n---\nThis is a replacement patch for\n\"t7610-mergetool: prefer test_config over git config\"\nin da/mergetool-tests.\n\nChanges since v1:\n\nThe changes are more surgical and the commit message mentions\nwhy we are using test_config.\n\n t/t7610-mergetool.sh | 8 +++-----\n 1 file changed, 3 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh\nindex 1a15e06..4fec633 100755\n--- a/t/t7610-mergetool.sh\n+++ b/t/t7610-mergetool.sh\n@@ -112,7 +112,7 @@ test_expect_success 'custom mergetool' '\n '\n \n test_expect_success 'mergetool crlf' '\n-\tgit config core.autocrlf true &&\n+\ttest_config core.autocrlf true &&\n \tgit checkout -b test2 branch1 &&\n \ttest_must_fail git merge master >/dev/null 2>&1 &&\n \t( yes \"\" | git mergetool file1 >/dev/null 2>&1 ) &&\n@@ -505,14 +505,12 @@ test_expect_success 'file with no base' '\n \n test_expect_success 'custom commands override built-ins' '\n \tgit checkout -b test14 branch1 &&\n-\tgit config mergetool.defaults.cmd \"cat \\\"\\$REMOTE\\\" >\\\"\\$MERGED\\\"\" &&\n-\tgit config mergetool.defaults.trustExitCode true &&\n+\ttest_config mergetool.defaults.cmd \"cat \\\"\\$REMOTE\\\" >\\\"\\$MERGED\\\"\" &&\n+\ttest_config mergetool.defaults.trustExitCode true &&\n \ttest_must_fail git merge master &&\n \tgit mergetool --no-prompt --tool defaults -- both &&\n \techo master both added >expected &&\n \ttest_cmp both expected &&\n-\tgit config --unset mergetool.defaults.cmd &&\n-\tgit config --unset mergetool.defaults.trustExitCode &&\n \tgit reset --hard master >/dev/null 2>&1\n '\n \n-- \n2.1.2.453.g1b015e3\n"}]}