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 <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
acedcde76d
commit
4170188262
@ -961,11 +961,11 @@ static struct ref_iterator *packed_ref_iterator_begin(
|
|||||||
* by the failing call to `fprintf()`.
|
* by the failing call to `fprintf()`.
|
||||||
*/
|
*/
|
||||||
static int write_packed_entry(FILE *fh, const char *refname,
|
static int write_packed_entry(FILE *fh, const char *refname,
|
||||||
const unsigned char *sha1,
|
const struct object_id *oid,
|
||||||
const unsigned char *peeled)
|
const struct object_id *peeled)
|
||||||
{
|
{
|
||||||
if (fprintf(fh, "%s %s\n", sha1_to_hex(sha1), refname) < 0 ||
|
if (fprintf(fh, "%s %s\n", oid_to_hex(oid), refname) < 0 ||
|
||||||
(peeled && fprintf(fh, "^%s\n", sha1_to_hex(peeled)) < 0))
|
(peeled && fprintf(fh, "^%s\n", oid_to_hex(peeled)) < 0))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -1203,8 +1203,8 @@ static int write_with_updates(struct packed_ref_store *refs,
|
|||||||
int peel_error = ref_iterator_peel(iter, &peeled);
|
int peel_error = ref_iterator_peel(iter, &peeled);
|
||||||
|
|
||||||
if (write_packed_entry(out, iter->refname,
|
if (write_packed_entry(out, iter->refname,
|
||||||
iter->oid->hash,
|
iter->oid,
|
||||||
peel_error ? NULL : peeled.hash))
|
peel_error ? NULL : &peeled))
|
||||||
goto write_error;
|
goto write_error;
|
||||||
|
|
||||||
if ((ok = ref_iterator_advance(iter)) != ITER_OK)
|
if ((ok = ref_iterator_advance(iter)) != ITER_OK)
|
||||||
@ -1224,8 +1224,8 @@ static int write_with_updates(struct packed_ref_store *refs,
|
|||||||
&peeled);
|
&peeled);
|
||||||
|
|
||||||
if (write_packed_entry(out, update->refname,
|
if (write_packed_entry(out, update->refname,
|
||||||
update->new_oid.hash,
|
&update->new_oid,
|
||||||
peel_error ? NULL : peeled.hash))
|
peel_error ? NULL : &peeled))
|
||||||
goto write_error;
|
goto write_error;
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
|
Loading…
Reference in New Issue
Block a user