Merge branch 'rs/simplify-transport-get'
[gitweb.git] / pack-bitmap-write.c
index 5d353ad6a7ebd3ee236f590f84fca5ec32acd6b2..c05d1386af7210e75a1012f3772745315ecc3592 100644 (file)
@@ -111,8 +111,7 @@ static inline void push_bitmapped_commit(struct commit *commit, struct ewah_bitm
 {
        if (writer.selected_nr >= writer.selected_alloc) {
                writer.selected_alloc = (writer.selected_alloc + 32) * 2;
-               writer.selected = xrealloc(writer.selected,
-                                          writer.selected_alloc * sizeof(struct bitmapped_commit));
+               REALLOC_ARRAY(writer.selected, writer.selected_alloc);
        }
 
        writer.selected[writer.selected_nr].commit = commit;
@@ -528,7 +527,7 @@ void bitmap_writer_finish(struct pack_idx_entry **index,
        header.version = htons(default_version);
        header.options = htons(flags | options);
        header.entry_count = htonl(writer.selected_nr);
-       memcpy(header.checksum, writer.pack_checksum, 20);
+       hashcpy(header.checksum, writer.pack_checksum);
 
        sha1write(f, &header, sizeof(header));
        dump_bitmap(f, writer.commits);