diff options
Diffstat (limited to 'bulk-checkin.c')
-rw-r--r-- | bulk-checkin.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/bulk-checkin.c b/bulk-checkin.c index 583aacb9e3..b023d9959a 100644 --- a/bulk-checkin.c +++ b/bulk-checkin.c @@ -100,6 +100,7 @@ static int stream_to_pack(struct bulk_checkin_state *state, const char *path, unsigned flags) { git_zstream s; + unsigned char ibuf[16384]; unsigned char obuf[16384]; unsigned hdrlen; int status = Z_OK; @@ -113,8 +114,6 @@ static int stream_to_pack(struct bulk_checkin_state *state, s.avail_out = sizeof(obuf) - hdrlen; while (status != Z_STREAM_END) { - unsigned char ibuf[16384]; - if (size && !s.avail_in) { ssize_t rsize = size < sizeof(ibuf) ? size : sizeof(ibuf); ssize_t read_result = read_in_full(fd, ibuf, rsize); @@ -211,7 +210,7 @@ static int deflate_to_pack(struct bulk_checkin_state *state, /* Note: idx is non-NULL when we are writing */ if ((flags & HASH_WRITE_OBJECT) != 0) - idx = xcalloc(1, sizeof(*idx)); + CALLOC_ARRAY(idx, 1); already_hashed_to = 0; @@ -238,7 +237,7 @@ static int deflate_to_pack(struct bulk_checkin_state *state, if (lseek(fd, seekback, SEEK_SET) == (off_t) -1) return error("cannot seek back"); } - the_hash_algo->final_fn(result_oid->hash, &ctx); + the_hash_algo->final_oid_fn(result_oid, &ctx); if (!idx) return 0; |