* Common steps for loose object writers to end writing loose objects: * * - End the compression of zlib stream. * - Get the calculated oid to "oid". */
| 730 | * - Get the calculated oid to "oid". |
| 731 | */ |
| 732 | static 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 | |
| 750 | int write_loose_object(struct odb_source_loose *loose, |
| 751 | const struct object_id *oid, char *hdr, |
no test coverage detected