t2002-checkout-cache-u.sh 741 字节
Newer Older
1 2 3 4 5
#!/bin/sh
#
# Copyright (c) 2005 Junio C Hamano
#

6
test_description='git checkout-index -u test.
7

8 9
With -u flag, git checkout-index internally runs the equivalent of
git update-index --refresh on the checked out entry.'
10 11 12 13 14 15

. ./test-lib.sh

test_expect_success \
'preparation' '
echo frotz >path0 &&
16 17
git update-index --add path0 &&
t=$(git write-tree)'
18

J
Junio C Hamano 已提交
19
test_expect_success \
20
'without -u, git checkout-index smudges stat information.' '
21
rm -f path0 &&
22 23
git read-tree $t &&
git checkout-index -f -a &&
24
test_must_fail git diff-files --exit-code'
25 26

test_expect_success \
27
'with -u, git checkout-index picks up stat information from new files.' '
28
rm -f path0 &&
29 30
git read-tree $t &&
git checkout-index -u -f -a &&
31
git diff-files --exit-code'
J
Junio C Hamano 已提交
32 33

test_done