Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-03-23 01:26:07 +0300
committerJunio C Hamano <gitster@pobox.com>2009-03-23 01:26:07 +0300
commit150115aded2e1e0a83db7366f59e4b5bf1aa8135 (patch)
treef573f9b2222062c312d49af8cbe59a62d5af7ed6 /t/t4020-diff-external.sh
parentea02eef096d4bfcbb83e76cfab0fcb42dbcad35e (diff)
diff --cached: do not borrow from a work tree when a path is marked as assume-unchanged
When the index says that the file in the work tree that corresponds to the blob object that is used for comparison is known to be unchanged, "diff" reads from the file and applies convert_to_git(), instead of inflating the object, to feed the internal diff engine with, because an earlier benchnark found that it tends to be faster to use this optimization. However, the index can lie when the path is marked as assume-unchanged. Disable the optimization for such paths. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4020-diff-external.sh')
-rwxr-xr-xt/t4020-diff-external.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t4020-diff-external.sh b/t/t4020-diff-external.sh
index 637b4e19d5..f853b8a894 100755
--- a/t/t4020-diff-external.sh
+++ b/t/t4020-diff-external.sh
@@ -107,4 +107,12 @@ test_expect_success 'force diff with "diff"' '
test_cmp ../t4020/diff.NUL actual
'
+test_expect_success 'diff --cached' '
+ git add file &&
+ git update-index --assume-unchanged file &&
+ echo second >file &&
+ git diff --cached >actual &&
+ test_cmp ../t4020/diff.NUL actual
+'
+
test_done