diff mbox series

[17/26] builtin/repack: write object IDs of the proper length

Message ID 20190818200427.870753-18-sandals@crustytoothpaste.net (mailing list archive)
State New, archived
Headers show
Series object_id part 17 | expand

Commit Message

brian m. carlson Aug. 18, 2019, 8:04 p.m. UTC
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>
---
 builtin/repack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/builtin/repack.c b/builtin/repack.c
index 632c0c0a79..5830f796e0 100644
--- a/builtin/repack.c
+++ b/builtin/repack.c
@@ -190,7 +190,7 @@  static int write_oid(const struct object_id *oid, struct packed_git *pack,
 			die(_("could not start pack-objects to repack promisor objects"));
 	}
 
-	xwrite(cmd->in, oid_to_hex(oid), GIT_SHA1_HEXSZ);
+	xwrite(cmd->in, oid_to_hex(oid), the_hash_algo->hexsz);
 	xwrite(cmd->in, "\n", 1);
 	return 0;
 }