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>
Pat Thoyts committed
Jul 17, 2014 at 17:37 UTC
44cf1c0ef1989eb5cfcaec203b427ddeac2ecaa8
1 file changed
+13
-4
t/t9902-completion.sh
+13
-4
@@ -212,9 +212,18 @@ test_expect_success '__gitdir - non-existing $GIT_DIR' '
212
)
213
'
214
215
+function pwd_P_W () {
216
+ if test_have_prereq MINGW
217
+ then
218
+ pwd -W
219
+ else
220
+ pwd -P
221
+ fi
222
+}
223
+
224
test_expect_success '__gitdir - gitfile in cwd' '
216
- echo "$(pwd -P)/otherrepo/.git" >expected &&
217
- echo "gitdir: $TRASH_DIRECTORY/otherrepo/.git" >subdir/.git &&
225
+ echo "$(pwd_P_W)/otherrepo/.git" >expected &&
226
+ echo "gitdir: $(pwd_P_W)/otherrepo/.git" >subdir/.git &&
227
test_when_finished "rm -f subdir/.git" &&
228
(
229
cd subdir &&
@@ -224,8 +233,8 @@ test_expect_success '__gitdir - gitfile in cwd' '
233
'
234
235
test_expect_success '__gitdir - gitfile in parent' '
227
- echo "$(pwd -P)/otherrepo/.git" >expected &&
228
- echo "gitdir: $TRASH_DIRECTORY/otherrepo/.git" >subdir/.git &&
236
+ echo "$(pwd_P_W)/otherrepo/.git" >expected &&
237
+ echo "gitdir: $(pwd_P_W)/otherrepo/.git" >subdir/.git &&
238
test_when_finished "rm -f subdir/.git" &&
239
(
240
cd subdir/subsubdir &&