]> git.ipfire.org Git - thirdparty/git.git/blame - t/t2002-checkout-cache-u.sh
Merge branch 'fixes'
[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
215a7ad1 6test_description='git-checkout-index -u test.
415e96c8 7
215a7ad1
JH
8With -u flag, git-checkout-index internally runs the equivalent of
9git-update-index --refresh on the checked out entry.'
415e96c8
JH
10
11. ./test-lib.sh
12
13test_expect_success \
14'preparation' '
15echo frotz >path0 &&
215a7ad1 16git-update-index --add path0 &&
415e96c8
JH
17t=$(git-write-tree)'
18
19test_expect_failure \
215a7ad1 20'without -u, git-checkout-index smudges stat information.' '
415e96c8
JH
21rm -f path0 &&
22git-read-tree $t &&
215a7ad1 23git-checkout-index -f -a &&
415e96c8
JH
24git-diff-files | diff - /dev/null'
25
26test_expect_success \
215a7ad1 27'with -u, git-checkout-index picks up stat information from new files.' '
415e96c8
JH
28rm -f path0 &&
29git-read-tree $t &&
215a7ad1 30git-checkout-index -u -f -a &&
415e96c8 31git-diff-files | diff - /dev/null'
57fe64a4
JH
32
33test_done