aboutsummaryrefslogtreecommitdiffstats
path: root/read-cache.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-09 17:09:34 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-09 17:09:34 -0700
commitd6d3f9d0125a7215f3cdc2600b2307ca55b69536 (patch)
treea869cb0789d8ad87f04d28dd9b703f3ff343a4a7 /read-cache.c
parent4e6616ab77ed6a53f857d4b1082c4dc4140f34f5 (diff)
downloadgit-d6d3f9d0125a7215f3cdc2600b2307ca55b69536.tar.gz
This implements the new "recursive tree" write-tree.
It's got some debugging printouts etc still in it, but testing on the kernel seems to show that it does indeed fix the issue with huge tree files for each commit.
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/read-cache.c b/read-cache.c
index ac8375a7f0..91b2628e3c 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -168,7 +168,7 @@ void * read_sha1_file(unsigned char *sha1, char *type, unsigned long *size)
return NULL;
}
-int write_sha1_file(char *buf, unsigned len)
+int write_sha1_file(char *buf, unsigned len, unsigned char *returnsha1)
{
int size;
char *compressed;
@@ -199,7 +199,8 @@ int write_sha1_file(char *buf, unsigned len)
if (write_sha1_buffer(sha1, compressed, size) < 0)
return -1;
- printf("%s\n", sha1_to_hex(sha1));
+ if (returnsha1)
+ memcpy(returnsha1, sha1, 20);
return 0;
}