3 test_description
='Various filesystem issues'
7 auml
=$
(printf '\303\244')
8 aumlcdiar
=$
(printf '\141\314\210')
12 test_expect_success
'see what we expect' '
14 test_unicode=test_expect_success &&
17 case "$(cd junk && echo *)" in
19 test_unicode=test_expect_failure &&
26 ln -s x y 2> /dev/null &&
27 test -h y 2> /dev/null ||
33 if test_have_prereq CASE_INSENSITIVE_FS
35 say
"will test on a case insensitive filesystem"
36 test_case
=test_expect_failure
38 test_case
=test_expect_success
42 say
"will test on a unicode corrupting filesystem"
43 test "$no_symlinks" &&
44 say
"will test on a filesystem lacking symbolic links"
46 if test_have_prereq CASE_INSENSITIVE_FS
48 test_expect_success
"detection of case insensitive filesystem during repo init" '
50 test $(git config --bool core.ignorecase) = true
53 test_expect_success
"detection of case insensitive filesystem during repo init" '
55 test_must_fail git config --bool core.ignorecase >/dev/null ||
56 test $(git config --bool core.ignorecase) = false
60 if test "$no_symlinks"
62 test_expect_success
"detection of filesystem w/o symlink support during repo init" '
64 v=$(git config --bool core.symlinks) &&
68 test_expect_success
"detection of filesystem w/o symlink support during repo init" '
70 test_must_fail git config --bool core.symlinks ||
71 test "$(git config --bool core.symlinks)" = true
75 test_expect_success
"setup case tests" '
77 git config core.ignorecase true &&
80 git commit -m "initial" &&
82 git checkout -b topic &&
83 git mv camelcase tmp &&
84 git mv tmp CamelCase &&
85 git commit -m "rename" &&
86 git checkout -f master
90 $test_case 'rename (case change)' '
92 git mv camelcase CamelCase &&
93 git commit -m "rename"
97 $test_case 'merge (case change)' '
101 git reset --hard initial &&
108 test_expect_failure
'add (with different case)' '
110 git reset --hard initial &&
114 camel=$(git ls-files | grep -i camelcase) &&
115 test $(echo "$camel" | wc -l) = 1 &&
116 test "z$(git cat-file blob :$camel)" = z1
120 test_expect_success
"setup unicode normalization tests" '
122 test_create_repo unicode &&
124 touch "$aumlcdiar" &&
125 git add "$aumlcdiar" &&
126 git commit -m initial &&
128 git checkout -b topic &&
129 git mv $aumlcdiar tmp &&
130 git mv tmp "$auml" &&
131 git commit -m rename &&
132 git checkout -f master
136 $test_unicode 'rename (silent unicode normalization)' '
138 git mv "$aumlcdiar" "$auml" &&
143 $test_unicode 'merge (silent unicode normalization)' '
145 git reset --hard initial &&