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