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