t0050: Set core.ignorecase case to activate case insensitivity
[git/raj.git] / t / t0050-filesystem.sh
blob399b45df1fdfd3d359152ecc2e87ee085dd6a358
1 #!/bin/sh
3 test_description='Various filesystem issues'
5 . ./test-lib.sh
7 auml=`printf '\xc3\xa4'`
8 aumlcdiar=`printf '\x61\xcc\x88'`
10 case_insensitive=
11 test_expect_success 'see if we expect ' '
13 test_case=test_expect_success
14 test_unicode=test_expect_success
15 mkdir junk &&
16 echo good >junk/CamelCase &&
17 echo bad >junk/camelcase &&
18 if test "$(cat junk/CamelCase)" != good
19 then
20 test_case=test_expect_failure
21 case_insensitive=t
22 say "will test on a case insensitive filesystem"
23 fi &&
24 rm -fr junk &&
25 mkdir junk &&
26 >junk/"$auml" &&
27 case "$(cd junk && echo *)" in
28 "$aumlcdiar")
29 test_unicode=test_expect_failure
30 say "will test on a unicode corrupting filesystem"
32 *) ;;
33 esac &&
34 rm -fr junk
37 if test "$case_insensitive"
38 then
39 test_expect_success "detection of case insensitive filesystem during repo init" '
41 test $(git config --bool core.ignorecase) = true
43 else
44 test_expect_success "detection of case insensitive filesystem during repo init" '
46 ! git config --bool core.ignorecase >/dev/null ||
47 test $(git config --bool core.ignorecase) = false
51 test_expect_success "setup case tests" '
53 git config core.ignorecase true &&
54 touch camelcase &&
55 git add camelcase &&
56 git commit -m "initial" &&
57 git tag initial &&
58 git checkout -b topic &&
59 git mv camelcase tmp &&
60 git mv tmp CamelCase &&
61 git commit -m "rename" &&
62 git checkout -f master
66 $test_case 'rename (case change)' '
68 git mv camelcase CamelCase &&
69 git commit -m "rename"
73 $test_case 'merge (case change)' '
75 git reset --hard initial &&
76 git merge topic
80 test_expect_success "setup unicode normalization tests" '
82 test_create_repo unicode &&
83 cd unicode &&
84 touch "$aumlcdiar" &&
85 git add "$aumlcdiar" &&
86 git commit -m initial
87 git tag initial &&
88 git checkout -b topic &&
89 git mv $aumlcdiar tmp &&
90 git mv tmp "$auml" &&
91 git commit -m rename &&
92 git checkout -f master
96 $test_unicode 'rename (silent unicode normalization)' '
98 git mv "$aumlcdiar" "$auml" &&
99 git commit -m rename
103 $test_unicode 'merge (silent unicode normalization)' '
105 git reset --hard initial &&
106 git merge topic
110 test_done