From abdc3fc84216a9334f40f3b7ce13e20a825697d0 Mon Sep 17 00:00:00 2001 From: Rene Scharfe Date: Sat, 14 Oct 2006 12:45:36 +0200 Subject: Add hash_sha1_file() Most callers of write_sha1_file_prepare() are only interested in the resulting hash but don't care about the returned file name or the header. This patch adds a simple wrapper named hash_sha1_file() which does just that, and converts potential callers. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- cache-tree.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'cache-tree.c') diff --git a/cache-tree.c b/cache-tree.c index 323c68a670..d388848dd2 100644 --- a/cache-tree.c +++ b/cache-tree.c @@ -344,12 +344,8 @@ static int update_one(struct cache_tree *it, #endif } - if (dryrun) { - unsigned char hdr[200]; - int hdrlen; - write_sha1_file_prepare(buffer, offset, tree_type, it->sha1, - hdr, &hdrlen); - } + if (dryrun) + hash_sha1_file(buffer, offset, tree_type, it->sha1); else write_sha1_file(buffer, offset, tree_type, it->sha1); free(buffer); -- cgit v1.2.3