diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-07-06 13:38:19 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-07-06 13:38:20 -0700 |
commit | afb516e364c996a9b75e55c68776762abe7eaa31 (patch) | |
tree | 17c729b6f9b7643ce17311d6c9a658839618db78 /t | |
parent | 3efeb513281ed59cc4c62be53256fd59832caa23 (diff) | |
parent | 412b9a16a007df93adcc88c0963a31399013ea37 (diff) | |
download | git-afb516e364c996a9b75e55c68776762abe7eaa31.tar.gz |
Merge branch 'jc/t2300-setup'
Portability fix for Windows.
* jc/t2300-setup:
t2300: "git --exec-path" is not usable in $PATH on Windows as-is
Diffstat (limited to 't')
-rwxr-xr-x | t/t2300-cd-to-toplevel.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/t/t2300-cd-to-toplevel.sh b/t/t2300-cd-to-toplevel.sh index cccd7d923a..c8de6d8a19 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" ] |