Skip to content

Commit 4170188

Browse files
mhaggergitster
authored andcommitted
write_packed_entry(): take object_id arguments
Change `write_packed_entry()` to take `struct object_id *` rather than `unsigned char *` arguments. Signed-off-by: Michael Haggerty <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent acedcde commit 4170188

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

refs/packed-backend.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -961,11 +961,11 @@ static struct ref_iterator *packed_ref_iterator_begin(
961961
* by the failing call to `fprintf()`.
962962
*/
963963
static int write_packed_entry(FILE *fh, const char *refname,
964-
const unsigned char *sha1,
965-
const unsigned char *peeled)
964+
const struct object_id *oid,
965+
const struct object_id *peeled)
966966
{
967-
if (fprintf(fh, "%s %s\n", sha1_to_hex(sha1), refname) < 0 ||
968-
(peeled && fprintf(fh, "^%s\n", sha1_to_hex(peeled)) < 0))
967+
if (fprintf(fh, "%s %s\n", oid_to_hex(oid), refname) < 0 ||
968+
(peeled && fprintf(fh, "^%s\n", oid_to_hex(peeled)) < 0))
969969
return -1;
970970

971971
return 0;
@@ -1203,8 +1203,8 @@ static int write_with_updates(struct packed_ref_store *refs,
12031203
int peel_error = ref_iterator_peel(iter, &peeled);
12041204

12051205
if (write_packed_entry(out, iter->refname,
1206-
iter->oid->hash,
1207-
peel_error ? NULL : peeled.hash))
1206+
iter->oid,
1207+
peel_error ? NULL : &peeled))
12081208
goto write_error;
12091209

12101210
if ((ok = ref_iterator_advance(iter)) != ITER_OK)
@@ -1224,8 +1224,8 @@ static int write_with_updates(struct packed_ref_store *refs,
12241224
&peeled);
12251225

12261226
if (write_packed_entry(out, update->refname,
1227-
update->new_oid.hash,
1228-
peel_error ? NULL : peeled.hash))
1227+
&update->new_oid,
1228+
peel_error ? NULL : &peeled))
12291229
goto write_error;
12301230

12311231
i++;

0 commit comments

Comments
 (0)