]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t6130/t9350: prepare for stringent Win32 path validation
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 9 Sep 2019 13:43:35 +0000 (15:43 +0200)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Thu, 5 Dec 2019 14:37:06 +0000 (15:37 +0100)
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 <johannes.schindelin@gmx.de>
t/t6130-pathspec-noglob.sh
t/t9350-fast-export.sh

index 658353277ee1e2c1b666d22961a8141dbb1bdd17..4129d9fd9aa8f64bc578d091aa48435d19b7a372 100755 (executable)
@@ -10,6 +10,7 @@ test_expect_success 'create commits with glob characters' '
        # the name "f*" in the worktree, because it is not allowed
        # on Windows (the tests below do not depend on the presence
        # of the file in the worktree)
+       git config core.protectNTFS false &&
        git update-index --add --cacheinfo 100644 "$(git rev-parse HEAD:foo)" "f*" &&
        test_tick &&
        git commit -m star &&
index e6062071e6cb2b8a780f9e596a0bab3cfac2b1ab..15b167d29d9acff7d48070d6f73e62099b63106d 100755 (executable)
@@ -424,7 +424,7 @@ test_expect_success 'fast-export quotes pathnames' '
        test_config -C crazy-paths core.protectNTFS false &&
        (cd crazy-paths &&
         blob=$(echo foo | git hash-object -w --stdin) &&
-        git update-index --add \
+        git -c core.protectNTFS=false update-index --add \
                --cacheinfo 100644 $blob "$(printf "path with\\nnewline")" \
                --cacheinfo 100644 $blob "path with \"quote\"" \
                --cacheinfo 100644 $blob "path with \\backslash" \