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 <patryk.obara@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patryk Obara
2018-01-28 01:13:19 +01:00
committed by Junio C Hamano
parent bbca96d579
commit a09c985eae
18 changed files with 65 additions and 58 deletions

View File

@ -1567,7 +1567,7 @@ int commit_tree_extended(const char *msg, size_t msg_len,
goto out;
}
result = write_sha1_file(buffer.buf, buffer.len, commit_type, ret->hash);
result = write_object_file(buffer.buf, buffer.len, commit_type, ret);
out:
strbuf_release(&buffer);
return result;