summaryrefslogtreecommitdiff
path: root/t/t9902-completion.sh
diff options
context:
space:
mode:
authorPat Thoyts <patthoyts@users.sourceforge.net>2014-07-17 17:37:04 +0200
committerJunio C Hamano <gitster@pobox.com>2014-07-21 09:39:57 -0700
commit44cf1c0ef1989eb5cfcaec203b427ddeac2ecaa8 (patch)
treeb87abc8e8ff97ae635e4609def9adbe010937439 /t/t9902-completion.sh
parent5212f91deb03056480cb01d60d27a107dc7cf680 (diff)
downloadgit-44cf1c0ef1989eb5cfcaec203b427ddeac2ecaa8.tar.gz
t9902: mingw-specific fix for gitfile link files
The path in a .git platform independent link file needs to be absolute and under mingw we need it to be a windows type path, not a unix style path so it should start with a drive letter and not a /. Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net> Signed-off-by: Stepan Kasal <kasal@ucw.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9902-completion.sh')
-rwxr-xr-xt/t9902-completion.sh17
1 files changed, 13 insertions, 4 deletions
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 1d1c1063a3..f10a75290e 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -212,9 +212,18 @@ test_expect_success '__gitdir - non-existing $GIT_DIR' '
)
'
+function pwd_P_W () {
+ if test_have_prereq MINGW
+ then
+ pwd -W
+ else
+ pwd -P
+ fi
+}
+
test_expect_success '__gitdir - gitfile in cwd' '
- echo "$(pwd -P)/otherrepo/.git" >expected &&
- echo "gitdir: $TRASH_DIRECTORY/otherrepo/.git" >subdir/.git &&
+ echo "$(pwd_P_W)/otherrepo/.git" >expected &&
+ echo "gitdir: $(pwd_P_W)/otherrepo/.git" >subdir/.git &&
test_when_finished "rm -f subdir/.git" &&
(
cd subdir &&
@@ -224,8 +233,8 @@ test_expect_success '__gitdir - gitfile in cwd' '
'
test_expect_success '__gitdir - gitfile in parent' '
- echo "$(pwd -P)/otherrepo/.git" >expected &&
- echo "gitdir: $TRASH_DIRECTORY/otherrepo/.git" >subdir/.git &&
+ echo "$(pwd_P_W)/otherrepo/.git" >expected &&
+ echo "gitdir: $(pwd_P_W)/otherrepo/.git" >subdir/.git &&
test_when_finished "rm -f subdir/.git" &&
(
cd subdir/subsubdir &&