1#!/bin/sh
   2#
   3# Copyright (c) 2005 Junio C Hamano
   4#
   5test_description='git-checkout-index -u test.
   7With -u flag, git-checkout-index internally runs the equivalent of
   9git-update-index --refresh on the checked out entry.'
  10. ./test-lib.sh
  12test_expect_success \
  14'preparation' '
  15echo frotz >path0 &&
  16git-update-index --add path0 &&
  17t=$(git-write-tree)'
  18test_expect_failure \
  20'without -u, git-checkout-index smudges stat information.' '
  21rm -f path0 &&
  22git-read-tree $t &&
  23git-checkout-index -f -a &&
  24git-diff-files | diff - /dev/null'
  25test_expect_success \
  27'with -u, git-checkout-index picks up stat information from new files.' '
  28rm -f path0 &&
  29git-read-tree $t &&
  30git-checkout-index -u -f -a &&
  31git-diff-files | diff - /dev/null'
  32test_done