]>
Commit | Line | Data |
---|---|---|
415e96c8 JH |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2005 Junio C Hamano | |
4 | # | |
5 | ||
5be60078 | 6 | test_description='git checkout-index -u test. |
415e96c8 | 7 | |
5be60078 JH |
8 | With -u flag, git checkout-index internally runs the equivalent of |
9 | git update-index --refresh on the checked out entry.' | |
415e96c8 JH |
10 | |
11 | . ./test-lib.sh | |
12 | ||
13 | test_expect_success \ | |
14 | 'preparation' ' | |
15 | echo frotz >path0 && | |
5be60078 JH |
16 | git update-index --add path0 && |
17 | t=$(git write-tree)' | |
415e96c8 | 18 | |
41ac414e | 19 | test_expect_success \ |
5be60078 | 20 | 'without -u, git checkout-index smudges stat information.' ' |
415e96c8 | 21 | rm -f path0 && |
5be60078 JH |
22 | git read-tree $t && |
23 | git checkout-index -f -a && | |
97ad535b | 24 | test_must_fail git diff-files --exit-code' |
415e96c8 JH |
25 | |
26 | test_expect_success \ | |
5be60078 | 27 | 'with -u, git checkout-index picks up stat information from new files.' ' |
415e96c8 | 28 | rm -f path0 && |
5be60078 JH |
29 | git read-tree $t && |
30 | git checkout-index -u -f -a && | |
97ad535b | 31 | git diff-files --exit-code' |
57fe64a4 JH |
32 | |
33 | test_done |