Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
t9902: mingw-specific fix for gitfile link files
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
patthoyts authored and kasal committed Jun 2, 2014
1 parent 6969703 commit 9b61244
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions t/t9902-completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand All @@ -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 &&
Expand Down

0 comments on commit 9b61244

Please sign in to comment.