From c8bae7493d2f2910b57f13ded012e86bdcfb0532 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 16:47:53 +0200 Subject: Adding upstream version 1:2.39.2. Signed-off-by: Daniel Baumann --- t/t2002-checkout-cache-u.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 t/t2002-checkout-cache-u.sh (limited to 't/t2002-checkout-cache-u.sh') diff --git a/t/t2002-checkout-cache-u.sh b/t/t2002-checkout-cache-u.sh new file mode 100755 index 0000000..fc95cf9 --- /dev/null +++ b/t/t2002-checkout-cache-u.sh @@ -0,0 +1,34 @@ +#!/bin/sh +# +# Copyright (c) 2005 Junio C Hamano +# + +test_description='git checkout-index -u test. + +With -u flag, git checkout-index internally runs the equivalent of +git update-index --refresh on the checked out entry.' + +TEST_PASSES_SANITIZE_LEAK=true +. ./test-lib.sh + +test_expect_success \ +'preparation' ' +echo frotz >path0 && +git update-index --add path0 && +t=$(git write-tree)' + +test_expect_success \ +'without -u, git checkout-index smudges stat information.' ' +rm -f path0 && +git read-tree $t && +git checkout-index -f -a && +test_must_fail git diff-files --exit-code' + +test_expect_success \ +'with -u, git checkout-index picks up stat information from new files.' ' +rm -f path0 && +git read-tree $t && +git checkout-index -u -f -a && +git diff-files --exit-code' + +test_done -- cgit v1.2.3