]> git.ipfire.org Git - thirdparty/git.git/blobdiff - packfile.c
Merge branch 'rs/hashwrite-be64'
[thirdparty/git.git] / packfile.c
index 06d51eddac117ddf92458b317486916e52fedb18..0929ebe4fc747fc52c98d45542d9b257dc25a31d 100644 (file)
@@ -923,6 +923,7 @@ unsigned long repo_approximate_object_count(struct repository *r)
                        count += p->num_objects;
                }
                r->objects->approximate_object_count = count;
+               r->objects->approximate_object_count_valid = 1;
        }
        return r->objects->approximate_object_count;
 }
@@ -1027,6 +1028,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;