The sixth batch for 2.18
[gitweb.git] / t / t2300-cd-to-toplevel.sh
index cccd7d923aae118b3f80aa52763648a2b4b189f2..c8de6d8a1902209ef98ec0832296ed9060310429 100755 (executable)
@@ -4,11 +4,19 @@ test_description='cd_to_toplevel'
 
 . ./test-lib.sh
 
+EXEC_PATH="$(git --exec-path)"
+test_have_prereq !MINGW ||
+case "$EXEC_PATH" in
+[A-Za-z]:/*)
+       EXEC_PATH="/${EXEC_PATH%%:*}${EXEC_PATH#?:}"
+       ;;
+esac
+
 test_cd_to_toplevel () {
        test_expect_success $3 "$2" '
                (
                        cd '"'$1'"' &&
-                       PATH="$(git --exec-path):$PATH" &&
+                       PATH="$EXEC_PATH:$PATH" &&
                        . git-sh-setup &&
                        cd_to_toplevel &&
                        [ "$(pwd -P)" = "$TOPLEVEL" ]