aboutsummaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-06-02 15:20:54 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-02 15:48:33 -0700
commit65c2e0c349aa5c7f605defb52dc67f1b3658a1b9 (patch)
tree011b8aba6186497e2eece190bb560165a9b44f8f /cache.h
parent4a62b61939396c512bd7592f800110bddf45af72 (diff)
downloadgit-65c2e0c349aa5c7f605defb52dc67f1b3658a1b9.tar.gz
git-65c2e0c349aa5c7f605defb52dc67f1b3658a1b9.tar.xz
[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 <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index e54176b4b..481f7c787 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);