diff options
Diffstat (limited to 'bulk-checkin.c')
-rw-r--r-- | bulk-checkin.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bulk-checkin.c b/bulk-checkin.c index de1f4040c7..9f3b644811 100644 --- a/bulk-checkin.c +++ b/bulk-checkin.c @@ -8,6 +8,7 @@ #include "pack.h" #include "strbuf.h" #include "packfile.h" +#include "object-store.h" static struct bulk_checkin_state { unsigned plugged:1; @@ -36,9 +37,9 @@ static void finish_bulk_checkin(struct bulk_checkin_state *state) unlink(state->pack_tmp_name); goto clear_exit; } else if (state->nr_written == 1) { - hashclose(state->f, oid.hash, CSUM_FSYNC); + finalize_hashfile(state->f, oid.hash, CSUM_HASH_IN_STREAM | CSUM_FSYNC | CSUM_CLOSE); } else { - int fd = hashclose(state->f, oid.hash, 0); + int fd = finalize_hashfile(state->f, oid.hash, 0); fixup_pack_header_footer(fd, oid.hash, state->pack_tmp_name, state->nr_written, oid.hash, state->offset); @@ -230,7 +231,7 @@ static int deflate_to_pack(struct bulk_checkin_state *state, * pack, and write into it. */ if (!idx) - die("BUG: should not happen"); + BUG("should not happen"); hashfile_truncate(state->f, &checkpoint); state->offset = checkpoint.offset; finish_bulk_checkin(state); |