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" '
32 test $(git config --bool core.ignorecase) = true
35 test_expect_success "detection of case insensitive filesystem during repo init" '
37 test_must_fail git config --bool core.ignorecase >/dev/null ||
38 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
52 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" '
59 git config core.ignorecase true &&
62 git commit -m "initial" &&
64 git checkout -b topic &&
65 git mv camelcase tmp &&
66 git mv tmp CamelCase &&
67 git commit -m "rename" &&
68 git checkout -f master
71 test_expect_success 'rename (case change)' '
72 git mv camelcase CamelCase &&
73 git commit -m "rename"
76 test_expect_success 'merge (case change)' '
79 git reset --hard initial &&
83 test_expect_success CASE_INSENSITIVE_FS 'add directory (with different case)' '
84 git reset --hard initial &&
88 git add dir1/dir2/a &&
89 git add dir1/DIR2/b &&
90 git ls-files >actual &&
91 cat >expected <<-\EOF &&
96 test_cmp expected actual
99 test_expect_failure CASE_INSENSITIVE_FS 'add (with different case)' '
100 git reset --hard initial &&
104 camel=$(git ls-files | grep -i camelcase) &&
105 test $(echo "$camel" | wc -l) = 1 &&
106 test "z$(git cat-file blob :$camel)" = z1
109 test_expect_success "setup unicode normalization tests" '
110 test_create_repo unicode &&
112 git config core.precomposeunicode false &&
113 touch "$aumlcdiar" &&
114 git add "$aumlcdiar" &&
115 git commit -m initial &&
117 git checkout -b topic &&
118 git mv $aumlcdiar tmp &&
119 git mv tmp "$auml" &&
120 git commit -m rename &&
121 git checkout -f master
124 $test_unicode 'rename (silent unicode normalization)' '
125 git mv "$aumlcdiar" "$auml" &&
129 $test_unicode 'merge (silent unicode normalization)' '
130 git reset --hard initial &&
134 test_expect_success CASE_INSENSITIVE_FS 'checkout with no pathspec and a case insensitive fs' '
141 git commit -m "add Gitweb" &&
143 git checkout --orphan todo &&
145 mkdir -p gitweb/subdir &&
146 >gitweb/subdir/file &&
148 git commit -m "add gitweb/subdir/file" &&