Skip to content

Commit bb2feec

Browse files
committed
Merge branch 'ad/cygwin-no-backslashes-in-paths'
Cygwin pathname handling fix. * ad/cygwin-no-backslashes-in-paths: cygwin: disallow backslashes in file names
2 parents 6d99f31 + bccc37f commit bb2feec

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

read-cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ int verify_path(const char *path, unsigned mode)
10111011
}
10121012
}
10131013
if (protect_ntfs) {
1014-
#ifdef GIT_WINDOWS_NATIVE
1014+
#if defined GIT_WINDOWS_NATIVE || defined __CYGWIN__
10151015
if (c == '\\')
10161016
return 0;
10171017
#endif

t/t7415-submodule-names.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ test_expect_success 'fsck detects corrupt .gitmodules' '
191191
)
192192
'
193193

194-
test_expect_success MINGW 'prevent git~1 squatting on Windows' '
194+
test_expect_success WINDOWS 'prevent git~1 squatting on Windows' '
195195
git init squatting &&
196196
(
197197
cd squatting &&
@@ -219,10 +219,13 @@ test_expect_success MINGW 'prevent git~1 squatting on Windows' '
219219
test_tick &&
220220
git -c core.protectNTFS=false commit -m "module"
221221
) &&
222-
test_must_fail git -c core.protectNTFS=false \
223-
clone --recurse-submodules squatting squatting-clone 2>err &&
224-
test_i18ngrep -e "directory not empty" -e "not an empty directory" err &&
225-
! grep gitdir squatting-clone/d/a/git~2
222+
if test_have_prereq MINGW
223+
then
224+
test_must_fail git -c core.protectNTFS=false \
225+
clone --recurse-submodules squatting squatting-clone 2>err &&
226+
test_i18ngrep -e "directory not empty" -e "not an empty directory" err &&
227+
! grep gitdir squatting-clone/d/a/git~2
228+
fi
226229
'
227230

228231
test_expect_success 'git dirs of sibling submodules must not be nested' '

t/test-lib.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,6 +1459,7 @@ case $uname_s in
14591459
test_set_prereq NATIVE_CRLF
14601460
test_set_prereq SED_STRIPS_CR
14611461
test_set_prereq GREP_STRIPS_CR
1462+
test_set_prereq WINDOWS
14621463
GIT_TEST_CMP=mingw_test_cmp
14631464
;;
14641465
*CYGWIN*)
@@ -1467,6 +1468,7 @@ case $uname_s in
14671468
test_set_prereq CYGWIN
14681469
test_set_prereq SED_STRIPS_CR
14691470
test_set_prereq GREP_STRIPS_CR
1471+
test_set_prereq WINDOWS
14701472
;;
14711473
*)
14721474
test_set_prereq POSIXPERM

0 commit comments

Comments
 (0)