path: root/cache.h
diff options
authorJunio C Hamano <>2005-06-02 22:20:54 (GMT)
committerLinus Torvalds <>2005-06-02 22:48:33 (GMT)
commit65c2e0c349aa5c7f605defb52dc67f1b3658a1b9 (patch)
tree011b8aba6186497e2eece190bb560165a9b44f8f /cache.h
parent4a62b61939396c512bd7592f800110bddf45af72 (diff)
[PATCH] Find size of SHA1 object without inflating everything.
This adds sha1_file_size() helper function and uses it in the rename/copy similarity estimator. The helper function handles deltified object as well. Signed-off-by: Junio C Hamano <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'cache.h')
1 files changed, 1 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index e54176b..481f7c7 100644
--- a/cache.h
+++ b/cache.h
@@ -154,6 +154,7 @@ extern void * map_sha1_file(const unsigned char *sha1, unsigned long *size);
extern int unpack_sha1_header(z_stream *stream, void *map, unsigned long mapsize, void *buffer, unsigned long size);
extern int parse_sha1_header(char *hdr, char *type, unsigned long *sizep);
extern int sha1_delta_base(const unsigned char *, unsigned char *);
+extern int sha1_file_size(const unsigned char *, unsigned long *);
extern void * unpack_sha1_file(void *map, unsigned long mapsize, char *type, unsigned long *size);
extern void * read_sha1_file(const unsigned char *sha1, char *type, unsigned long *size);
extern int write_sha1_file(void *buf, unsigned long len, const char *type, unsigned char *return_sha1);