3 test_description
='Various filesystem issues'
7 auml
=$
(printf '\303\244')
8 aumlcdiar
=$
(printf '\141\314\210')
11 test_expect_success
'see what we expect' '
13 test_unicode=test_expect_success &&
16 case "$(cd junk && echo *)" in
18 test_unicode=test_expect_failure &&
26 if test_have_prereq CASE_INSENSITIVE_FS
28 say
"will test on a case insensitive filesystem"
29 test_case
=test_expect_failure
31 test_case
=test_expect_success
35 say
"will test on a unicode corrupting filesystem"
36 test_have_prereq SYMLINKS ||
37 say
"will test on a filesystem lacking symbolic links"
39 if test_have_prereq CASE_INSENSITIVE_FS
41 test_expect_success
"detection of case insensitive filesystem during repo init" '
43 test $(git config --bool core.ignorecase) = true
46 test_expect_success
"detection of case insensitive filesystem during repo init" '
48 test_must_fail git config --bool core.ignorecase >/dev/null ||
49 test $(git config --bool core.ignorecase) = false
53 if test_have_prereq SYMLINKS
55 test_expect_success
"detection of filesystem w/o symlink support during repo init" '
57 test_must_fail git config --bool core.symlinks ||
58 test "$(git config --bool core.symlinks)" = true
61 test_expect_success
"detection of filesystem w/o symlink support during repo init" '
63 v=$(git config --bool core.symlinks) &&
68 test_expect_success
"setup case tests" '
70 git config core.ignorecase true &&
73 git commit -m "initial" &&
75 git checkout -b topic &&
76 git mv camelcase tmp &&
77 git mv tmp CamelCase &&
78 git commit -m "rename" &&
79 git checkout -f master
83 $test_case 'rename (case change)' '
85 git mv camelcase CamelCase &&
86 git commit -m "rename"
90 $test_case 'merge (case change)' '
94 git reset --hard initial &&
101 test_expect_failure
'add (with different case)' '
103 git reset --hard initial &&
107 camel=$(git ls-files | grep -i camelcase) &&
108 test $(echo "$camel" | wc -l) = 1 &&
109 test "z$(git cat-file blob :$camel)" = z1
113 test_expect_success
"setup unicode normalization tests" '
115 test_create_repo unicode &&
117 touch "$aumlcdiar" &&
118 git add "$aumlcdiar" &&
119 git commit -m initial &&
121 git checkout -b topic &&
122 git mv $aumlcdiar tmp &&
123 git mv tmp "$auml" &&
124 git commit -m rename &&
125 git checkout -f master
129 $test_unicode 'rename (silent unicode normalization)' '
131 git mv "$aumlcdiar" "$auml" &&
136 $test_unicode 'merge (silent unicode normalization)' '
138 git reset --hard initial &&