From a09c985eae694db1cf31c72db0e2e1bf42f1274f Mon Sep 17 00:00:00 2001 From: Patryk Obara Date: Sun, 28 Jan 2018 01:13:19 +0100 Subject: sha1_file: convert write_sha1_file to object_id Convert the definition and declaration of write_sha1_file to struct object_id and adjust usage of this function. This commit also converts static function write_sha1_file_prepare, as it is closely related. Rename these functions to write_object_file and write_object_file_prepare respectively. Replace sha1_to_hex, hashcpy and hashclr with their oid equivalents wherever possible. Signed-off-by: Patryk Obara Signed-off-by: Junio C Hamano --- cache-tree.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cache-tree.c') diff --git a/cache-tree.c b/cache-tree.c index 6574eeb80d..597114f604 100644 --- a/cache-tree.c +++ b/cache-tree.c @@ -406,9 +406,10 @@ static int update_one(struct cache_tree *it, oidcpy(&it->oid, &oid); else to_invalidate = 1; - } else if (dryrun) + } else if (dryrun) { hash_object_file(buffer.buf, buffer.len, tree_type, &it->oid); - else if (write_sha1_file(buffer.buf, buffer.len, tree_type, it->oid.hash)) { + } else if (write_object_file(buffer.buf, buffer.len, tree_type, + &it->oid)) { strbuf_release(&buffer); return -1; } -- cgit v1.2.3