midx: pass a repository pointer
[gitweb.git] / packfile.c
index b5ec0eeddd68cab7e1c5bd3bc58f4328fef049ab..7b94a14726d0641e24c5248502e11933472da890 100644 (file)
@@ -235,7 +235,7 @@ struct packed_git *parse_pack_index(unsigned char *sha1, const char *idx_path)
        struct packed_git *p = alloc_packed_git(alloc);
 
        memcpy(p->pack_name, path, alloc); /* includes NUL */
-       hashcpy(p->sha1, sha1);
+       hashcpy(p->hash, sha1);
        if (check_packed_git_idx(idx_path, p)) {
                free(p);
                return NULL;
@@ -732,8 +732,8 @@ struct packed_git *add_packed_git(const char *path, size_t path_len, int local)
        p->pack_local = local;
        p->mtime = st.st_mtime;
        if (path_len < the_hash_algo->hexsz ||
-           get_sha1_hex(path + path_len - the_hash_algo->hexsz, p->sha1))
-               hashclr(p->sha1);
+           get_sha1_hex(path + path_len - the_hash_algo->hexsz, p->hash))
+               hashclr(p->hash);
        return p;
 }
 
@@ -1035,7 +1035,7 @@ struct packed_git *get_all_packs(struct repository *r)
                for (m = r->objects->multi_pack_index; m; m = m->next) {
                        uint32_t i;
                        for (i = 0; i < m->num_packs; i++) {
-                               if (!prepare_midx_pack(m, i)) {
+                               if (!prepare_midx_pack(r, m, i)) {
                                        m->packs[i]->next = p;
                                        p = m->packs[i];
                                }
@@ -1998,7 +1998,7 @@ int find_pack_entry(struct repository *r, const struct object_id *oid, struct pa
                return 0;
 
        for (m = r->objects->multi_pack_index; m; m = m->next) {
-               if (fill_midx_entry(oid, e, m))
+               if (fill_midx_entry(r, oid, e, m))
                        return 1;
        }