remote-curl: refactor smart-http discovery
[gitweb.git] / builtin / gc.c
index 7696017cd4152eb191972d2d662c592030ac811e..020f725acc40f413c49f812ea0e6aac0153d097c 100644 (file)
@@ -659,8 +659,10 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
 
        report_garbage = report_pack_garbage;
        reprepare_packed_git(the_repository);
-       if (pack_garbage.nr > 0)
+       if (pack_garbage.nr > 0) {
+               close_all_packs(the_repository->objects);
                clean_pack_garbage();
+       }
 
        if (gc_write_commit_graph)
                write_commit_graph_reachable(get_object_directory(), 0,