]> git.ipfire.org Git - thirdparty/git.git/blobdiff - packfile.c
Merge branch 'al/t3200-back-on-a-branch'
[thirdparty/git.git] / packfile.c
index f4e752996dbcca3778c42de1d55d856a28be974d..9ef27508f2ed6d2685e5d85cd92667ac735140d5 100644 (file)
@@ -178,6 +178,7 @@ int load_idx(const char *path, const unsigned int hashsz, void *idx_map,
                     */
                    (sizeof(off_t) <= 4))
                        return error("pack too large for current definition of off_t in %s", path);
+               p->crc_offset = 8 + 4 * 256 + nr * hashsz;
        }
 
        p->index_version = version;
@@ -1026,6 +1027,17 @@ struct multi_pack_index *get_multi_pack_index(struct repository *r)
        return r->objects->multi_pack_index;
 }
 
+struct multi_pack_index *get_local_multi_pack_index(struct repository *r)
+{
+       struct multi_pack_index *m = get_multi_pack_index(r);
+
+       /* no need to iterate; we always put the local one first (if any) */
+       if (m && m->local)
+               return m;
+
+       return NULL;
+}
+
 struct packed_git *get_all_packs(struct repository *r)
 {
        struct multi_pack_index *m;