builtin/fmt-merge-msg: convert remaining code to object_id
authorbrian m. carlson <sandals@crustytoothpaste.net>
Mon, 12 Mar 2018 02:27:47 +0000 (02:27 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 Mar 2018 16:23:49 +0000 (09:23 -0700)
We were using the util pointer, which is a pointer to void, as an
unsigned char pointer. The pointer actually points to a struct
origin_data, which has a struct object_id as its first member, which in
turn has an unsigned char array as its first member, so this was valid.
Since we want to convert this to struct object_id, simply change the
pointer we're using.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fmt-merge-msg.c
index 8e8a15ea4ad6de2bb73f63d39a0895a263918774..0bc0dda99cd2ad74d5aa59831bac402264da0ae5 100644 (file)
@@ -485,10 +485,10 @@ static void fmt_merge_msg_sigs(struct strbuf *out)
        struct strbuf tagbuf = STRBUF_INIT;
 
        for (i = 0; i < origins.nr; i++) {
-               unsigned char *sha1 = origins.items[i].util;
+               struct object_id *oid = origins.items[i].util;
                enum object_type type;
                unsigned long size, len;
-               char *buf = read_sha1_file(sha1, &type, &size);
+               char *buf = read_sha1_file(oid->hash, &type, &size);
                struct strbuf sig = STRBUF_INIT;
 
                if (!buf || type != OBJ_TAG)