difftool: fallback on merge.guitool
[gitweb.git] / t / t7610-mergetool.sh
index dad607e1864b472a2e2ed9bb3821b33ddc795d93..5b61c10a9c5402bfca8473f663076f9062a2e2a4 100755 (executable)
@@ -167,6 +167,25 @@ test_expect_success 'gui mergetool' '
        git commit -m "branch1 resolved with mergetool"
 '
 
+test_expect_success 'gui mergetool without merge.guitool set falls back to merge.tool' '
+       test_when_finished "git reset --hard" &&
+       git checkout -b test$test_count branch1 &&
+       git submodule update -N &&
+       test_must_fail git merge master &&
+       ( yes "" | git mergetool --gui both ) &&
+       ( yes "" | git mergetool -g file1 file1 ) &&
+       ( yes "" | git mergetool --gui file2 "spaced name" ) &&
+       ( yes "" | git mergetool --gui subdir/file3 ) &&
+       ( yes "d" | git mergetool --gui file11 ) &&
+       ( yes "d" | git mergetool --gui file12 ) &&
+       ( yes "l" | git mergetool --gui submod ) &&
+       test "$(cat file1)" = "master updated" &&
+       test "$(cat file2)" = "master new" &&
+       test "$(cat subdir/file3)" = "master new sub" &&
+       test "$(cat submod/bar)" = "branch1 submodule" &&
+       git commit -m "branch1 resolved with mergetool"
+'
+
 test_expect_success 'mergetool crlf' '
        test_when_finished "git reset --hard" &&
        # This test_config line must go after the above reset line so that