summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-08-03 22:10:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-08-03 22:10:29 (GMT)
commit767da54bf8bd212a483097999ee9ba77b711e4a8 (patch)
tree85dbfebd28cf3134a9bd5515d240c66d506fdd90 /t
parentf4fa8a9b18a840539edf908bb82b54c5f82aab31 (diff)
parent06dec439a3d00fa0b3141a2d52b33d22b941976c (diff)
downloadgit-767da54bf8bd212a483097999ee9ba77b711e4a8.zip
git-767da54bf8bd212a483097999ee9ba77b711e4a8.tar.gz
git-767da54bf8bd212a483097999ee9ba77b711e4a8.tar.bz2
Merge branch 'jk/diff-do-not-reuse-wtf-needs-cleaning'
There is an optimization used in "git diff $treeA $treeB" to borrow an already checked-out copy in the working tree when it is known to be the same as the blob being compared, expecting that open/mmap of such a file is faster than reading it from the object store, which involves inflating and applying delta. This however kicked in even when the checked-out copy needs to go through the convert-to-git conversion (including the clean filter), which defeats the whole point of the optimization. The optimization has been disabled when the conversion is necessary. * jk/diff-do-not-reuse-wtf-needs-cleaning: diff: do not reuse worktree files that need "clean" conversion
Diffstat (limited to 't')
-rwxr-xr-xt/t0021-conversion.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
index 7bac2bc..e799e59 100755
--- a/t/t0021-conversion.sh
+++ b/t/t0021-conversion.sh
@@ -268,4 +268,15 @@ test_expect_success 'disable filter with empty override' '
test_must_be_empty err
'
+test_expect_success 'diff does not reuse worktree files that need cleaning' '
+ test_config filter.counter.clean "echo . >>count; sed s/^/clean:/" &&
+ echo "file filter=counter" >.gitattributes &&
+ test_commit one file &&
+ test_commit two file &&
+
+ >count &&
+ git diff-tree -p HEAD &&
+ test_line_count = 0 count
+'
+
test_done