2005-05-16 05:23:12 +08:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2005 Junio C Hamano
|
|
|
|
#
|
|
|
|
|
2007-07-03 13:52:14 +08:00
|
|
|
test_description='git checkout-index -u test.
|
2005-05-16 05:23:12 +08:00
|
|
|
|
2007-07-03 13:52:14 +08:00
|
|
|
With -u flag, git checkout-index internally runs the equivalent of
|
|
|
|
git update-index --refresh on the checked out entry.'
|
2005-05-16 05:23:12 +08:00
|
|
|
|
|
|
|
. ./test-lib.sh
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'preparation' '
|
|
|
|
echo frotz >path0 &&
|
2007-07-03 13:52:14 +08:00
|
|
|
git update-index --add path0 &&
|
|
|
|
t=$(git write-tree)'
|
2005-05-16 05:23:12 +08:00
|
|
|
|
2008-02-01 17:50:53 +08:00
|
|
|
test_expect_success \
|
2007-07-03 13:52:14 +08:00
|
|
|
'without -u, git checkout-index smudges stat information.' '
|
2005-05-16 05:23:12 +08:00
|
|
|
rm -f path0 &&
|
2007-07-03 13:52:14 +08:00
|
|
|
git read-tree $t &&
|
|
|
|
git checkout-index -f -a &&
|
2008-04-27 19:31:23 +08:00
|
|
|
test_must_fail git diff-files --exit-code'
|
2005-05-16 05:23:12 +08:00
|
|
|
|
|
|
|
test_expect_success \
|
2007-07-03 13:52:14 +08:00
|
|
|
'with -u, git checkout-index picks up stat information from new files.' '
|
2005-05-16 05:23:12 +08:00
|
|
|
rm -f path0 &&
|
2007-07-03 13:52:14 +08:00
|
|
|
git read-tree $t &&
|
|
|
|
git checkout-index -u -f -a &&
|
2008-04-27 19:31:23 +08:00
|
|
|
git diff-files --exit-code'
|
2005-05-20 10:00:36 +08:00
|
|
|
|
|
|
|
test_done
|