summaryrefslogtreecommitdiff
path: root/diffcore-pickaxe.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-05-27 22:56:38 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-29 18:17:44 (GMT)
commitf0c6b2a2fd98b51f1f2655ea69ace9763da28e79 (patch)
tree29668f3fbfb0e4871ac17f72b144eb289be5e490 /diffcore-pickaxe.c
parent6145ee8b361959db04b8cdefc883e4fc2dc27276 (diff)
downloadgit-f0c6b2a2fd98b51f1f2655ea69ace9763da28e79.zip
git-f0c6b2a2fd98b51f1f2655ea69ace9763da28e79.tar.gz
git-f0c6b2a2fd98b51f1f2655ea69ace9763da28e79.tar.bz2
[PATCH] Optimize diff-tree -[CM] --stdin
This attempts to optimize "diff-tree -[CM] --stdin", which compares successible tree pairs. This optimization does not make much sense for other commands in the diff-* brothers. When reading from --stdin and using rename/copy detection, the patch makes diff-tree to read the current index file first. This is done to reuse the optimization used by diff-cache in the non-cached case. Similarity estimator can avoid expanding a blob if the index says what is in the work tree has an exact copy of that blob already expanded. Another optimization the patch makes is to check only file sizes first to terminate similarity estimation early. In order for this to work, it needs a way to tell the size of the blob without expanding it. Since an obvious way of doing it, which is to keep all the blobs previously used in the memory, is too costly, it does so by keeping the filesize for each object it has already seen in memory. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'diffcore-pickaxe.c')
-rw-r--r--diffcore-pickaxe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/diffcore-pickaxe.c b/diffcore-pickaxe.c
index 9cf3a50..ef9c5c1 100644
--- a/diffcore-pickaxe.c
+++ b/diffcore-pickaxe.c
@@ -11,7 +11,7 @@ static int contains(struct diff_filespec *one,
{
unsigned long offset, sz;
const char *data;
- if (diff_populate_filespec(one))
+ if (diff_populate_filespec(one, 0))
return 0;
sz = one->size;
data = one->data;