2005-05-16 01:23:12 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2005 Junio C Hamano
|
|
|
|
#
|
|
|
|
|
2005-09-08 04:26:23 +04:00
|
|
|
test_description='git-checkout-index -u test.
|
2005-05-16 01:23:12 +04:00
|
|
|
|
2005-09-08 04:26:23 +04:00
|
|
|
With -u flag, git-checkout-index internally runs the equivalent of
|
|
|
|
git-update-index --refresh on the checked out entry.'
|
2005-05-16 01:23:12 +04:00
|
|
|
|
|
|
|
. ./test-lib.sh
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'preparation' '
|
|
|
|
echo frotz >path0 &&
|
2005-09-08 04:26:23 +04:00
|
|
|
git-update-index --add path0 &&
|
2005-05-16 01:23:12 +04:00
|
|
|
t=$(git-write-tree)'
|
|
|
|
|
|
|
|
test_expect_failure \
|
2005-09-08 04:26:23 +04:00
|
|
|
'without -u, git-checkout-index smudges stat information.' '
|
2005-05-16 01:23:12 +04:00
|
|
|
rm -f path0 &&
|
|
|
|
git-read-tree $t &&
|
2005-09-08 04:26:23 +04:00
|
|
|
git-checkout-index -f -a &&
|
2005-05-16 01:23:12 +04:00
|
|
|
git-diff-files | diff - /dev/null'
|
|
|
|
|
|
|
|
test_expect_success \
|
2005-09-08 04:26:23 +04:00
|
|
|
'with -u, git-checkout-index picks up stat information from new files.' '
|
2005-05-16 01:23:12 +04:00
|
|
|
rm -f path0 &&
|
|
|
|
git-read-tree $t &&
|
2005-09-08 04:26:23 +04:00
|
|
|
git-checkout-index -u -f -a &&
|
2005-05-16 01:23:12 +04:00
|
|
|
git-diff-files | diff - /dev/null'
|
2005-05-20 06:00:36 +04:00
|
|
|
|
|
|
|
test_done
|