t / t2002-checkout-cache-u.shon commit Merge with gitk. (2b64f88)
   1#!/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'
  32
  33test_done