Merge branch 'sb/describe-long'
[git] / t / t0050-filesystem.sh
1 #!/bin/sh
2
3 test_description='Various filesystem issues'
4
5 . ./test-lib.sh
6
7 auml=`perl -CO -e 'print pack("U",0x00E4)'`
8 aumlcdiar=`perl -CO -e 'print pack("U",0x0061).pack("U",0x0308)'`
9
10 test_expect_success 'see if we expect ' '
11
12         test_case=test_expect_success
13         test_unicode=test_expect_success
14         mkdir junk &&
15         echo good >junk/CamelCase &&
16         echo bad >junk/camelcase &&
17         if test "$(cat junk/CamelCase)" != good
18         then
19                 test_case=test_expect_failure
20                 say "will test on a case insensitive filesystem"
21         fi &&
22         rm -fr junk &&
23         mkdir junk &&
24         >junk/"$auml" &&
25         case "$(cd junk && echo *)" in
26         "$aumlcdiar")
27                 test_unicode=test_expect_failure
28                 say "will test on a unicode corrupting filesystem"
29                 ;;
30         *)      ;;
31         esac &&
32         rm -fr junk
33 '
34
35 test_expect_success "setup case tests" '
36
37         touch camelcase &&
38         git add camelcase &&
39         git commit -m "initial" &&
40         git tag initial &&
41         git checkout -b topic &&
42         git mv camelcase tmp &&
43         git mv tmp CamelCase &&
44         git commit -m "rename" &&
45         git checkout -f master
46
47 '
48
49 $test_case 'rename (case change)' '
50
51         git mv camelcase CamelCase &&
52         git commit -m "rename"
53
54 '
55
56 $test_case 'merge (case change)' '
57
58         git reset --hard initial &&
59         git merge topic
60
61 '
62
63 test_expect_success "setup unicode normalization tests" '
64
65   test_create_repo unicode &&
66   cd unicode &&
67   touch "$aumlcdiar" &&
68   git add "$aumlcdiar" &&
69   git commit -m initial
70   git tag initial &&
71   git checkout -b topic &&
72   git mv $aumlcdiar tmp &&
73   git mv tmp "$auml" &&
74   git commit -m rename &&
75   git checkout -f master
76
77 '
78
79 $test_unicode 'rename (silent unicode normalization)' '
80
81  git mv "$aumlcdiar" "$auml" &&
82  git commit -m rename
83
84 '
85
86 $test_unicode 'merge (silent unicode normalization)' '
87
88  git reset --hard initial &&
89  git merge topic
90
91 '
92
93 test_done