debian: apply security fixes from 2.24.1
[git/debian.git] / debian / patches / 0023-t6130-t9350-prepare-for-stringent-Win32-path-validati.diff
blobc91b2bff0f97030840d7f239395ed08121c3f9af
1 From 11e41967929bc9351115dc0114af6221d38efcaa Mon Sep 17 00:00:00 2001
2 From: Johannes Schindelin <johannes.schindelin@gmx.de>
3 Date: Mon, 9 Sep 2019 15:43:35 +0200
4 Subject: t6130/t9350: prepare for stringent Win32 path validation
6 On Windows, file names cannot contain asterisks nor newline characters.
7 In an upcoming commit, we will make this limitation explicit,
8 disallowing even the creation of commits that introduce such file names.
10 However, in the test scripts touched by this patch, we _know_ that those
11 paths won't be checked out, so we _want_ to allow such file names.
13 Happily, the stringent path validation will be guarded via the
14 `core.protectNTFS` flag, so all we need to do is to force that flag off
15 temporarily.
17 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
18 (cherry picked from commit 35edce205615c553fdc49bcf10b0c91f061c56c9)
19 Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
20 ---
21 t/t6130-pathspec-noglob.sh | 1 +
22 t/t9350-fast-export.sh | 2 +-
23 2 files changed, 2 insertions(+), 1 deletion(-)
25 diff --git a/t/t6130-pathspec-noglob.sh b/t/t6130-pathspec-noglob.sh
26 index 37760233a5..ba7902c9cd 100755
27 --- a/t/t6130-pathspec-noglob.sh
28 +++ b/t/t6130-pathspec-noglob.sh
29 @@ -10,6 +10,7 @@ test_expect_success 'create commits with glob characters' '
30 # the name "f*" in the worktree, because it is not allowed
31 # on Windows (the tests below do not depend on the presence
32 # of the file in the worktree)
33 + git config core.protectNTFS false &&
34 git update-index --add --cacheinfo 100644 "$(git rev-parse HEAD:foo)" "f*" &&
35 test_tick &&
36 git commit -m star &&
37 diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh
38 index 11e5a87330..5ac9def433 100755
39 --- a/t/t9350-fast-export.sh
40 +++ b/t/t9350-fast-export.sh
41 @@ -603,7 +603,7 @@ test_expect_success 'fast-export quotes pathnames' '
42 test_config -C crazy-paths core.protectNTFS false &&
43 (cd crazy-paths &&
44 blob=$(echo foo | git hash-object -w --stdin) &&
45 - git update-index --add \
46 + git -c core.protectNTFS=false update-index --add \
47 --cacheinfo 100644 $blob "$(printf "path with\\nnewline")" \
48 --cacheinfo 100644 $blob "path with \"quote\"" \
49 --cacheinfo 100644 $blob "path with \\backslash" \
50 --
51 2.24.0.393.g34dc348eaf