]>
git.ipfire.org Git - thirdparty/git.git/blob - t/t1014-read-tree-confusing.sh
3 test_description
='check that read-tree rejects confusing paths'
7 test_expect_success
'create base tree' '
11 blob=$(git rev-parse HEAD:file) &&
12 tree=$(git rev-parse HEAD^{tree})
15 test_expect_success
'enable core.protectHFS for rejection tests' '
16 git config core.protectHFS true
19 test_expect_success
'enable core.protectNTFS for rejection tests' '
20 git config core.protectNTFS true
23 while read path pretty
; do
30 test_expect_success
"reject $pretty at end of path" '
31 printf "100644 blob %s\t%s" "$blob" "$path" >tree &&
32 bogus=$(git mktree <tree) &&
33 test_must_fail git read-tree $bogus
36 test_expect_success
"reject $pretty as subtree" '
37 printf "040000 tree %s\t%s" "$tree" "$path" >tree &&
38 bogus=$(git mktree <tree) &&
39 test_must_fail git read-tree $bogus
46 ${u200c}.Git {u200c}.Git
47 .gI${u200c}T .gI{u200c}T
48 .GiT${u200c} .GiT{u200c}
50 .git.SPACE .git.{space}
51 .\\\\.GIT\\\\foobar backslashes
52 .git\\\\foobar backslashes2
53 .git...:alternate-stream
56 test_expect_success
'utf-8 paths allowed with core.protectHFS off' '
57 test_when_finished "git read-tree HEAD" &&
58 test_config core.protectHFS false &&
59 printf "100644 blob %s\t%s" "$blob" ".gi${u200c}t" >tree &&
60 ok=$(git mktree <tree) &&