MCPcopy Create free account
hub / github.com/git/git / end_loose_object_common

Function end_loose_object_common

object-file.c:732–748  ·  view source on GitHub ↗

* Common steps for loose object writers to end writing loose objects: * * - End the compression of zlib stream. * - Get the calculated oid to "oid". */

Source from the content-addressed store, hash-verified

730 * - Get the calculated oid to "oid".
731 */
732static int end_loose_object_common(struct odb_source_loose *loose,
733 struct git_hash_ctx *c, struct git_hash_ctx *compat_c,
734 git_zstream *stream, struct object_id *oid,
735 struct object_id *compat_oid)
736{
737 const struct git_hash_algo *compat = loose->base.odb->repo->compat_hash_algo;
738 int ret;
739
740 ret = git_deflate_end_gently(stream);
741 if (ret != Z_OK)
742 return ret;
743 git_hash_final_oid(oid, c);
744 if (compat && compat_c)
745 git_hash_final_oid(compat_oid, compat_c);
746
747 return Z_OK;
748}
749
750int write_loose_object(struct odb_source_loose *loose,
751 const struct object_id *oid, char *hdr,

Callers 2

write_loose_objectFunction · 0.85

Calls 2

git_deflate_end_gentlyFunction · 0.85
git_hash_final_oidFunction · 0.85

Tested by

no test coverage detected