Merge branch 'js/partial-clone-connectivity-check'
[gitweb.git] / archive-tar.c
index 4aabd566fbb8af7065ebe8fa62afe8e8e70abe04..3e53aac1e6523571ce0b9cb02d151c1f00652603 100644 (file)
@@ -326,14 +326,15 @@ static int write_tar_entry(struct archiver_args *args,
 
 static void write_global_extended_header(struct archiver_args *args)
 {
-       const unsigned char *sha1 = args->commit_sha1;
+       const struct object_id *oid = args->commit_oid;
        struct strbuf ext_header = STRBUF_INIT;
        struct ustar_header header;
        unsigned int mode;
 
-       if (sha1)
+       if (oid)
                strbuf_append_ext_header(&ext_header, "comment",
-                                        sha1_to_hex(sha1), 40);
+                                        oid_to_hex(oid),
+                                        the_hash_algo->hexsz);
        if (args->time > USTAR_MAX_MTIME) {
                strbuf_append_ext_header_uint(&ext_header, "mtime",
                                              args->time);