]> git.ipfire.org Git - thirdparty/git.git/commitdiff
builtin/repack: write object IDs of the proper length
authorbrian m. carlson <sandals@crustytoothpaste.net>
Sun, 18 Aug 2019 20:04:18 +0000 (20:04 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 19 Aug 2019 22:04:58 +0000 (15:04 -0700)
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>
builtin/repack.c

index 632c0c0a79422a229d52c83665331501e8c54e29..5830f796e0a094820853081d7b99f1b4788ad934 100644 (file)
@@ -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;
 }