push: add a config option push.gpgSign for default signed pushes
[gitweb.git] / pack-bitmap-write.c
index 5f1791a59c5e9ecd553fb9109fa774d921f777c8..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;
@@ -473,7 +472,6 @@ static void write_selected_commits_v1(struct sha1file *f,
 
        for (i = 0; i < writer.selected_nr; ++i) {
                struct bitmapped_commit *stored = &writer.selected[i];
-               struct bitmap_disk_entry on_disk;
 
                int commit_pos =
                        sha1_pos(stored->commit->object.sha1, index, index_nr, sha1_access);
@@ -481,11 +479,10 @@ static void write_selected_commits_v1(struct sha1file *f,
                if (commit_pos < 0)
                        die("BUG: trying to write commit not in index");
 
-               on_disk.object_pos = htonl(commit_pos);
-               on_disk.xor_offset = stored->xor_offset;
-               on_disk.flags = stored->flags;
+               sha1write_be32(f, commit_pos);
+               sha1write_u8(f, stored->xor_offset);
+               sha1write_u8(f, stored->flags);
 
-               sha1write(f, &on_disk, sizeof(on_disk));
                dump_bitmap(f, stored->write_as);
        }
 }