git/t/t2002-checkout-cache-u.sh
Junio C Hamano 57fe64a40d [PATCH] diff overhaul
This cleans up the way calls are made into the diff core from diff-tree
family and diff-helper.  Earlier, these programs had "if
(generating_patch)" sprinkled all over the place, but those ugliness are
gone and handled uniformly from the diff core, even when not generating
patch format.

This also allowed diff-cache and diff-files to acquire -R
(reverse) option to generate diff in reverse.  Users of
diff-tree can swap two trees easily so I did not add -R there.

[ Linus' note: I'll add -R to "diff-tree" too, since a "commit
  diff" doesn't have another tree to switch around: the other
  tree is always the parent(s) of the commit ]

Also -M<digits-as-mantissa> suggestion made by Linus has been
implemented.

Documentation updates are also included.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-19 22:33:07 -07:00

33 lines
740 B
Bash

#!/bin/sh
#
# Copyright (c) 2005 Junio C Hamano
#
test_description='git-checkout-cache -u test.
With -u flag, git-checkout-cache internally runs the equivalent of
git-update-cache --refresh on the checked out entry.'
. ./test-lib.sh
test_expect_success \
'preparation' '
echo frotz >path0 &&
git-update-cache --add path0 &&
t=$(git-write-tree)'
test_expect_failure \
'without -u, git-checkout-cache smudges stat information.' '
rm -f path0 &&
git-read-tree $t &&
git-checkout-cache -f -a &&
git-diff-files | diff - /dev/null'
test_expect_success \
'with -u, git-checkout-cache picks up stat information from new files.' '
rm -f path0 &&
git-read-tree $t &&
git-checkout-cache -u -f -a &&
git-diff-files | diff - /dev/null'
test_done