diff options
Diffstat (limited to 'src/pack-objects.c')
-rw-r--r-- | src/pack-objects.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/pack-objects.c b/src/pack-objects.c index e5fc625a4..35c1d55db 100644 --- a/src/pack-objects.c +++ b/src/pack-objects.c @@ -1422,7 +1422,12 @@ int git_packbuilder_write( if ((error = git_indexer_commit(indexer, &stats)) < 0) goto cleanup; +#ifndef GIT_DEPRECATE_HARD git_oid_cpy(&pb->pack_oid, git_indexer_hash(indexer)); +#endif + + pb->pack_name = git__strdup(git_indexer_name(indexer)); + GIT_ERROR_CHECK_ALLOC(pb->pack_name); cleanup: git_indexer_free(indexer); @@ -1432,10 +1437,17 @@ cleanup: #undef PREPARE_PACK +#ifndef GIT_DEPRECATE_HARD const git_oid *git_packbuilder_hash(git_packbuilder *pb) { return &pb->pack_oid; } +#endif + +const char *git_packbuilder_name(git_packbuilder *pb) +{ + return pb->pack_name; +} static int cb_tree_walk( @@ -1803,5 +1815,7 @@ void git_packbuilder_free(git_packbuilder *pb) git_hash_ctx_cleanup(&pb->ctx); git_zstream_free(&pb->zstream); + git__free(pb->pack_name); + git__free(pb); } |