]> git.ipfire.org Git - thirdparty/git.git/blame - t/t2002-checkout-cache-u.sh
Start the 2.46 cycle
[thirdparty/git.git] / t / t2002-checkout-cache-u.sh
CommitLineData
415e96c8
JH
1#!/bin/sh
2#
3# Copyright (c) 2005 Junio C Hamano
4#
5
5be60078 6test_description='git checkout-index -u test.
415e96c8 7
5be60078
JH
8With -u flag, git checkout-index internally runs the equivalent of
9git update-index --refresh on the checked out entry.'
415e96c8 10
b7bcdbdb 11TEST_PASSES_SANITIZE_LEAK=true
415e96c8
JH
12. ./test-lib.sh
13
14test_expect_success \
15'preparation' '
16echo frotz >path0 &&
5be60078
JH
17git update-index --add path0 &&
18t=$(git write-tree)'
415e96c8 19
41ac414e 20test_expect_success \
5be60078 21'without -u, git checkout-index smudges stat information.' '
415e96c8 22rm -f path0 &&
5be60078
JH
23git read-tree $t &&
24git checkout-index -f -a &&
97ad535b 25test_must_fail git diff-files --exit-code'
415e96c8
JH
26
27test_expect_success \
5be60078 28'with -u, git checkout-index picks up stat information from new files.' '
415e96c8 29rm -f path0 &&
5be60078
JH
30git read-tree $t &&
31git checkout-index -u -f -a &&
97ad535b 32git diff-files --exit-code'
57fe64a4
JH
33
34test_done