send-pack: convert remaining functions to struct object_id
Convert the remaining function, feed_object, 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 12, 2018 at 02:27 UTC
246d7400fbe737c49efa0a42527f08317ab52b3f
1 file changed
+6
-6
send-pack.c
+6
-6
@@ -37,14 +37,14 @@ int option_parse_push_signed(const struct option *opt,
37
die("bad %s argument: %s", opt->long_name, arg);
38
}
39
40
-static void feed_object(const unsigned char *sha1, FILE *fh, int negative)
40
+static void feed_object(const struct object_id *oid, FILE *fh, int negative)
41
{
42
- if (negative && !has_sha1_file(sha1))
42
+ if (negative && !has_sha1_file(oid->hash))
43
return;
44
45
if (negative)
46
putc('^', fh);
47
- fputs(sha1_to_hex(sha1), fh);
47
+ fputs(oid_to_hex(oid), fh);
48
putc('\n', fh);
49
}
50
@@ -89,13 +89,13 @@ static int pack_objects(int fd, struct ref *refs, struct oid_array *extra, struc
89
*/
90
po_in = xfdopen(po.in, "w");
91
for (i = 0; i < extra->nr; i++)
92
- feed_object(extra->oid[i].hash, po_in, 1);
92
+ feed_object(&extra->oid[i], po_in, 1);
93
94
while (refs) {
95
if (!is_null_oid(&refs->old_oid))
96
- feed_object(refs->old_oid.hash, po_in, 1);
96
+ feed_object(&refs->old_oid, po_in, 1);
97
if (!is_null_oid(&refs->new_oid))
98
- feed_object(refs->new_oid.hash, po_in, 0);
98
+ feed_object(&refs->new_oid, po_in, 0);
99
refs = refs->next;
100
}
101