summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-07-11 17:44:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-07-11 17:44:19 (GMT)
commit3a30c14b9b4385d556c6bc8c99cdb41d27093939 (patch)
tree7304be3d2f6a74bc06c6a4f0bbdd739d4293305c
parent438d4e7583f83dcdd61630623640f9916ff80534 (diff)
parent412b9a16a007df93adcc88c0963a31399013ea37 (diff)
downloadgit-3a30c14b9b4385d556c6bc8c99cdb41d27093939.zip
git-3a30c14b9b4385d556c6bc8c99cdb41d27093939.tar.gz
git-3a30c14b9b4385d556c6bc8c99cdb41d27093939.tar.bz2
Merge branch 'jc/t2300-setup' into maint
Portability fix for Windows. * jc/t2300-setup: t2300: "git --exec-path" is not usable in $PATH on Windows as-is
-rwxr-xr-xt/t2300-cd-to-toplevel.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/t/t2300-cd-to-toplevel.sh b/t/t2300-cd-to-toplevel.sh
index cccd7d9..c8de6d8 100755
--- a/t/t2300-cd-to-toplevel.sh
+++ b/t/t2300-cd-to-toplevel.sh
@@ -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" ]