3 test_description='check that read-tree rejects confusing paths'
6 test_expect_success 'create base tree' '
10 blob=$(git rev-parse HEAD:file) &&
11 tree=$(git rev-parse HEAD^{tree})
14 test_expect_success 'enable core.protectHFS for rejection tests' '
15 git config core.protectHFS true
18 while read path pretty; do
20 test_expect_success "reject $pretty at end of path" '
21 printf "100644 blob %s\t%s" "$blob" "$path" >tree &&
22 bogus=$(git mktree <tree) &&
23 test_must_fail git read-tree $bogus
26 test_expect_success "reject $pretty as subtree" '
27 printf "040000 tree %s\t%s" "$tree" "$path" >tree &&
28 bogus=$(git mktree <tree) &&
29 test_must_fail git read-tree $bogus
36 ${u200c}.Git {u200c}.Git
37 .gI${u200c}T .gI{u200c}T
38 .GiT${u200c} .GiT{u200c}
41 test_expect_success 'utf-8 paths allowed with core.protectHFS off' '
42 test_when_finished "git read-tree HEAD" &&
43 test_config core.protectHFS false &&
44 printf "100644 blob %s\t%s" "$blob" ".gi${u200c}t" >tree &&
45 ok=$(git mktree <tree) &&