2005-05-16 01:23:12 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2005 Junio C Hamano
|
|
|
|
#
|
|
|
|
|
2007-07-03 09:52:14 +04:00
|
|
|
test_description='git checkout-index -u test.
|
2005-05-16 01:23:12 +04:00
|
|
|
|
2007-07-03 09:52:14 +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 &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git update-index --add path0 &&
|
|
|
|
t=$(git write-tree)'
|
2005-05-16 01:23:12 +04:00
|
|
|
|
2008-02-01 12:50:53 +03:00
|
|
|
test_expect_success \
|
2007-07-03 09:52:14 +04:00
|
|
|
'without -u, git checkout-index smudges stat information.' '
|
2005-05-16 01:23:12 +04:00
|
|
|
rm -f path0 &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git read-tree $t &&
|
|
|
|
git checkout-index -f -a &&
|
2008-04-27 15:31:23 +04:00
|
|
|
test_must_fail git diff-files --exit-code'
|
2005-05-16 01:23:12 +04:00
|
|
|
|
|
|
|
test_expect_success \
|
2007-07-03 09:52:14 +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 &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git read-tree $t &&
|
|
|
|
git checkout-index -u -f -a &&
|
2008-04-27 15:31:23 +04:00
|
|
|
git diff-files --exit-code'
|
2005-05-20 06:00:36 +04:00
|
|
|
|
|
|
|
test_done
|