implement fetching of moved submodules
[gitweb.git] / pack-bitmap.c
index 09de9ba312dc0c30c4182e5e0d14a0218ffeb39a..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
@@ -266,7 +267,7 @@ static int open_pack_bitmap_1(struct packed_git *packfile)
                return -1;
 
        idx_name = pack_bitmap_filename(packfile);
-       fd = git_open_noatime(idx_name);
+       fd = git_open(idx_name);
        free(idx_name);
 
        if (fd < 0)
@@ -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,11 +668,11 @@ 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.hash, NULL);
+                       parse_object_or_die(&object->oid, NULL);
 
                while (object->type == OBJ_TAG) {
                        struct tag *tag = (struct tag *) object;
@@ -685,7 +684,7 @@ int prepare_bitmap_walk(struct rev_info *revs)
 
                        if (!tag->tagged)
                                die("bad tag");
-                       object = parse_object_or_die(tag->tagged->oid.hash, NULL);
+                       object = parse_object_or_die(&tag->tagged->oid, NULL);
                }
 
                if (object->flags & UNINTERESTING)
@@ -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;