blob: 69146acc3a819b253817a029269f94f1dc0cb4c0 [file] [log] [blame]
Junio C Hamano415e96c2005-05-15 14:23:12 -07001#!/bin/sh
2#
3# Copyright (c) 2005 Junio C Hamano
4#
5
6test_description='git-checkout-cache -u test.
7
8With -u flag, git-checkout-cache internally runs the equivalent of
9git-update-cache --refresh on the checked out entry.'
10
11. ./test-lib.sh
12
13test_expect_success \
14'preparation' '
15echo frotz >path0 &&
16git-update-cache --add path0 &&
17t=$(git-write-tree)'
18
19test_expect_failure \
20'without -u, git-checkout-cache smudges stat information.' '
21rm -f path0 &&
22git-read-tree $t &&
23git-checkout-cache -f -a &&
24git-diff-files | diff - /dev/null'
25
26test_expect_success \
27'with -u, git-checkout-cache picks up stat information from new files.' '
28rm -f path0 &&
29git-read-tree $t &&
30git-checkout-cache -u -f -a &&
31git-diff-files | diff - /dev/null'
Junio C Hamano57fe64a2005-05-19 19:00:36 -070032
33test_done