3 test_description
='Various filesystem issues'
7 auml
=$
(printf '\303\244')
8 aumlcdiar
=$
(printf '\141\314\210')
10 if test_have_prereq CASE_INSENSITIVE_FS
12 say
"will test on a case insensitive filesystem"
13 test_case
=test_expect_failure
15 test_case
=test_expect_success
18 if test_have_prereq UTF8_NFD_TO_NFC
20 say
"will test on a unicode corrupting filesystem"
21 test_unicode
=test_expect_failure
23 test_unicode
=test_expect_success
26 test_have_prereq SYMLINKS ||
27 say
"will test on a filesystem lacking symbolic links"
29 if test_have_prereq CASE_INSENSITIVE_FS
31 test_expect_success
"detection of case insensitive filesystem during repo init" '
33 test $(git config --bool core.ignorecase) = true
36 test_expect_success
"detection of case insensitive filesystem during repo init" '
38 test_must_fail git config --bool core.ignorecase >/dev/null ||
39 test $(git config --bool core.ignorecase) = false
43 if test_have_prereq SYMLINKS
45 test_expect_success
"detection of filesystem w/o symlink support during repo init" '
47 test_must_fail git config --bool core.symlinks ||
48 test "$(git config --bool core.symlinks)" = true
51 test_expect_success
"detection of filesystem w/o symlink support during repo init" '
53 v=$(git config --bool core.symlinks) &&
58 test_expect_success
"setup case tests" '
60 git config core.ignorecase true &&
63 git commit -m "initial" &&
65 git checkout -b topic &&
66 git mv camelcase tmp &&
67 git mv tmp CamelCase &&
68 git commit -m "rename" &&
69 git checkout -f master
73 $test_case 'rename (case change)' '
75 git mv camelcase CamelCase &&
76 git commit -m "rename"
80 $test_case 'merge (case change)' '
84 git reset --hard initial &&
91 test_expect_failure
'add (with different case)' '
93 git reset --hard initial &&
97 camel=$(git ls-files | grep -i camelcase) &&
98 test $(echo "$camel" | wc -l) = 1 &&
99 test "z$(git cat-file blob :$camel)" = z1
103 test_expect_success
"setup unicode normalization tests" '
105 test_create_repo unicode &&
107 touch "$aumlcdiar" &&
108 git add "$aumlcdiar" &&
109 git commit -m initial &&
111 git checkout -b topic &&
112 git mv $aumlcdiar tmp &&
113 git mv tmp "$auml" &&
114 git commit -m rename &&
115 git checkout -f master
119 $test_unicode 'rename (silent unicode normalization)' '
121 git mv "$aumlcdiar" "$auml" &&
126 $test_unicode 'merge (silent unicode normalization)' '
128 git reset --hard initial &&