bulk-checkin.c: convert to use struct object_id
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
brian m. carlson committed
Mar 13, 2015 at 23:39 UTC
fa33c3aae238c683b2b15989b9d7f88df19fa93d
1 file changed
+6
-6
bulk-checkin.c
+6
-6
@@ -24,7 +24,7 @@ static struct bulk_checkin_state {
24
25
static void finish_bulk_checkin(struct bulk_checkin_state *state)
26
{
27
- unsigned char sha1[20];
27
+ struct object_id oid;
28
struct strbuf packname = STRBUF_INIT;
29
int i;
30
@@ -36,11 +36,11 @@ static void finish_bulk_checkin(struct bulk_checkin_state *state)
36
unlink(state->pack_tmp_name);
37
goto clear_exit;
38
} else if (state->nr_written == 1) {
39
- sha1close(state->f, sha1, CSUM_FSYNC);
39
+ sha1close(state->f, oid.hash, CSUM_FSYNC);
40
} else {
41
- int fd = sha1close(state->f, sha1, 0);
42
- fixup_pack_header_footer(fd, sha1, state->pack_tmp_name,
43
- state->nr_written, sha1,
41
+ int fd = sha1close(state->f, oid.hash, 0);
42
+ fixup_pack_header_footer(fd, oid.hash, state->pack_tmp_name,
43
+ state->nr_written, oid.hash,
44
state->offset);
45
close(fd);
46
}
@@ -48,7 +48,7 @@ static void finish_bulk_checkin(struct bulk_checkin_state *state)
48
strbuf_addf(&packname, "%s/pack/pack-", get_object_directory());
49
finish_tmp_packfile(&packname, state->pack_tmp_name,
50
state->written, state->nr_written,
51
- &state->pack_idx_opts, sha1);
51
+ &state->pack_idx_opts, oid.hash);
52
for (i = 0; i < state->nr_written; i++)
53
free(state->written[i]);
54