t5300, t5302, t5303: Do not use /dev/zero
[git/mjg.git] / t / t0050-filesystem.sh
bloba449580c8a2e41c665e1f29c56877e271fd17fef
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 unibad=
12 test_expect_success 'see if we expect ' '
14 test_case=test_expect_success
15 test_unicode=test_expect_success
16 mkdir junk &&
17 echo good >junk/CamelCase &&
18 echo bad >junk/camelcase &&
19 if test "$(cat junk/CamelCase)" != good
20 then
21 test_case=test_expect_failure
22 case_insensitive=t
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 unibad=t
32 *) ;;
33 esac &&
34 rm -fr junk
37 test "$case_insensitive" &&
38 say "will test on a case insensitive filesystem"
39 test "$unibad" &&
40 say "will test on a unicode corrupting filesystem"
42 if test "$case_insensitive"
43 then
44 test_expect_success "detection of case insensitive filesystem during repo init" '
46 test $(git config --bool core.ignorecase) = true
48 else
49 test_expect_success "detection of case insensitive filesystem during repo init" '
51 test_must_fail git config --bool core.ignorecase >/dev/null ||
52 test $(git config --bool core.ignorecase) = false
56 test_expect_success "setup case tests" '
58 git config core.ignorecase true &&
59 touch camelcase &&
60 git add camelcase &&
61 git commit -m "initial" &&
62 git tag initial &&
63 git checkout -b topic &&
64 git mv camelcase tmp &&
65 git mv tmp CamelCase &&
66 git commit -m "rename" &&
67 git checkout -f master
71 $test_case 'rename (case change)' '
73 git mv camelcase CamelCase &&
74 git commit -m "rename"
78 $test_case 'merge (case change)' '
80 rm -f CamelCase &&
81 rm -f camelcase &&
82 git reset --hard initial &&
83 git merge topic
87 $test_case 'add (with different case)' '
89 git reset --hard initial &&
90 rm camelcase &&
91 echo 1 >CamelCase &&
92 git add CamelCase &&
93 test $(git ls-files | grep -i camelcase | wc -l) = 1
97 test_expect_success "setup unicode normalization tests" '
99 test_create_repo unicode &&
100 cd unicode &&
101 touch "$aumlcdiar" &&
102 git add "$aumlcdiar" &&
103 git commit -m initial
104 git tag initial &&
105 git checkout -b topic &&
106 git mv $aumlcdiar tmp &&
107 git mv tmp "$auml" &&
108 git commit -m rename &&
109 git checkout -f master
113 $test_unicode 'rename (silent unicode normalization)' '
115 git mv "$aumlcdiar" "$auml" &&
116 git commit -m rename
120 $test_unicode 'merge (silent unicode normalization)' '
122 git reset --hard initial &&
123 git merge topic
127 test_done