Merge branch 'js/rebase-i-final'
[gitweb.git] / pack-bitmap.c
index 327634cd71b5c8fdd5ab531493c2de020bee869d..42e3d5f4f26ee0f31d13c2a3d15bc31da5f7c1d4 100644 (file)
@@ -9,6 +9,7 @@
 #include "pack-bitmap.h"
 #include "pack-revindex.h"
 #include "pack-objects.h"
+#include "packfile.h"
 
 /*
  * An entry on the bitmap index, representing the bitmap for a given
@@ -653,8 +654,6 @@ static int in_bitmapped_pack(struct object_list *roots)
 int prepare_bitmap_walk(struct rev_info *revs)
 {
        unsigned int i;
-       unsigned int pending_nr = revs->pending.nr;
-       struct object_array_entry *pending_e = revs->pending.objects;
 
        struct object_list *wants = NULL;
        struct object_list *haves = NULL;
@@ -669,8 +668,8 @@ int prepare_bitmap_walk(struct rev_info *revs)
                        return -1;
        }
 
-       for (i = 0; i < pending_nr; ++i) {
-               struct object *object = pending_e[i].item;
+       for (i = 0; i < revs->pending.nr; ++i) {
+               struct object *object = revs->pending.objects[i].item;
 
                if (object->type == OBJ_NONE)
                        parse_object_or_die(&object->oid, NULL);
@@ -714,9 +713,7 @@ int prepare_bitmap_walk(struct rev_info *revs)
        if (!bitmap_git.loaded && load_pack_bitmap() < 0)
                return -1;
 
-       revs->pending.nr = 0;
-       revs->pending.alloc = 0;
-       revs->pending.objects = NULL;
+       object_array_clear(&revs->pending);
 
        if (haves) {
                revs->ignore_missing_links = 1;