builtin/repack: write object IDs of the proper length
Use the_hash_algo when calling xwrite with a hex object ID so that the proper amount of data is written. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
brian m. carlson committed
Aug 18, 2019 at 20:04 UTC
dd336a55113a62789f039e382387d0407abaf922
1 file changed
+1
-1
builtin/repack.c
+1
-1
@@ -190,7 +190,7 @@ static int write_oid(const struct object_id *oid, struct packed_git *pack,
190
die(_("could not start pack-objects to repack promisor objects"));
191
}
192
193
- xwrite(cmd->in, oid_to_hex(oid), GIT_SHA1_HEXSZ);
193
+ xwrite(cmd->in, oid_to_hex(oid), the_hash_algo->hexsz);
194
xwrite(cmd->in, "\n", 1);
195
return 0;
196
}