Skip to content

Commit 35edce2

Browse files
committed
t6130/t9350: prepare for stringent Win32 path validation
On Windows, file names cannot contain asterisks nor newline characters. In an upcoming commit, we will make this limitation explicit, disallowing even the creation of commits that introduce such file names. However, in the test scripts touched by this patch, we _know_ that those paths won't be checked out, so we _want_ to allow such file names. Happily, the stringent path validation will be guarded via the `core.protectNTFS` flag, so all we need to do is to force that flag off temporarily. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 9102f95 commit 35edce2

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

t/t6130-pathspec-noglob.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ test_expect_success 'create commits with glob characters' '
1010
# the name "f*" in the worktree, because it is not allowed
1111
# on Windows (the tests below do not depend on the presence
1212
# of the file in the worktree)
13+
git config core.protectNTFS false &&
1314
git update-index --add --cacheinfo 100644 "$(git rev-parse HEAD:foo)" "f*" &&
1415
test_tick &&
1516
git commit -m star &&

t/t9350-fast-export.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ test_expect_success 'fast-export quotes pathnames' '
424424
test_config -C crazy-paths core.protectNTFS false &&
425425
(cd crazy-paths &&
426426
blob=$(echo foo | git hash-object -w --stdin) &&
427-
git update-index --add \
427+
git -c core.protectNTFS=false update-index --add \
428428
--cacheinfo 100644 $blob "$(printf "path with\\nnewline")" \
429429
--cacheinfo 100644 $blob "path with \"quote\"" \
430430
--cacheinfo 100644 $blob "path with \\backslash" \

0 commit comments

Comments
 (0)