]>
Commit | Line | Data |
---|---|---|
9fdade06 JH |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2005 Junio C Hamano | |
4 | # | |
5 | ||
6 | test_description='Test mode change diffs. | |
7 | ||
8 | ' | |
9 | . ./test-lib.sh | |
10 | ||
11 | test_expect_success \ | |
12 | 'setup' \ | |
13 | 'echo frotz >rezrov && | |
5be60078 JH |
14 | git update-index --add rezrov && |
15 | tree=`git write-tree` && | |
9fdade06 JH |
16 | echo $tree' |
17 | ||
e0d10e1c | 18 | if [ "$(git config --get core.filemode)" = false ] |
b484ef28 AR |
19 | then |
20 | say 'filemode disabled on the filesystem, using update-index --chmod=+x' | |
21 | test_expect_success \ | |
5be60078 JH |
22 | 'git update-index --chmod=+x' \ |
23 | 'git update-index rezrov && | |
24 | git update-index --chmod=+x rezrov && | |
25 | git diff-index $tree >current' | |
b484ef28 AR |
26 | else |
27 | test_expect_success \ | |
28 | 'chmod' \ | |
29 | 'chmod +x rezrov && | |
5be60078 JH |
30 | git update-index rezrov && |
31 | git diff-index $tree >current' | |
b484ef28 | 32 | fi |
9fdade06 JH |
33 | |
34 | _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]' | |
35 | _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40" | |
36 | sed -e 's/\(:100644 100755\) \('"$_x40"'\) \2 /\1 X X /' <current >check | |
37 | echo ":100644 100755 X X M rezrov" >expected | |
38 | ||
39 | test_expect_success \ | |
40 | 'verify' \ | |
3af82863 | 41 | 'test_cmp expected check' |
9fdade06 JH |
42 | |
43 | test_done |