Junio C Hamano | 415e96c | 2005-05-15 14:23:12 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # Copyright (c) 2005 Junio C Hamano |
| 4 | # |
| 5 | |
| 6 | test_description='git-checkout-cache -u test. |
| 7 | |
| 8 | With -u flag, git-checkout-cache internally runs the equivalent of |
| 9 | git-update-cache --refresh on the checked out entry.' |
| 10 | |
| 11 | . ./test-lib.sh |
| 12 | |
| 13 | test_expect_success \ |
| 14 | 'preparation' ' |
| 15 | echo frotz >path0 && |
| 16 | git-update-cache --add path0 && |
| 17 | t=$(git-write-tree)' |
| 18 | |
| 19 | test_expect_failure \ |
| 20 | 'without -u, git-checkout-cache smudges stat information.' ' |
| 21 | rm -f path0 && |
| 22 | git-read-tree $t && |
| 23 | git-checkout-cache -f -a && |
| 24 | git-diff-files | diff - /dev/null' |
| 25 | |
| 26 | test_expect_success \ |
| 27 | 'with -u, git-checkout-cache picks up stat information from new files.' ' |
| 28 | rm -f path0 && |
| 29 | git-read-tree $t && |
| 30 | git-checkout-cache -u -f -a && |
| 31 | git-diff-files | diff - /dev/null' |
Junio C Hamano | 57fe64a | 2005-05-19 19:00:36 -0700 | [diff] [blame] | 32 | |
| 33 | test_done |