object-store: close all packs upon clearing the object store
[gitweb.git] / builtin / fsck.c
index c736a10a114e7112e7437d4798a849e8a64c8aa4..77074072754240c0d9508ffc68f2deb77fd2b3c1 100644 (file)
@@ -732,7 +732,8 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
                        prepare_packed_git();
 
                        if (show_progress) {
-                               for (p = packed_git; p; p = p->next) {
+                               for (p = get_packed_git(the_repository); p;
+                                    p = p->next) {
                                        if (open_pack_index(p))
                                                continue;
                                        total += p->num_objects;
@@ -740,7 +741,8 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
 
                                progress = start_progress(_("Checking objects"), total);
                        }
-                       for (p = packed_git; p; p = p->next) {
+                       for (p = get_packed_git(the_repository); p;
+                            p = p->next) {
                                /* verify gives error messages itself */
                                if (verify_pack(p, fsck_obj_buffer,
                                                progress, count))