Merge branch 'ds/close-object-store'
[gitweb.git] / builtin / repack.c
index 67f8978043a43988d653092f83f21bd5baad9751..f834b5551b1ffe003b943c18cd35397e9196e730 100644 (file)
@@ -14,7 +14,7 @@
 
 static int delta_base_offset = 1;
 static int pack_kept_objects = -1;
-static int write_bitmaps;
+static int write_bitmaps = -1;
 static int use_delta_islands;
 static char *packdir, *packtmp;
 
@@ -343,6 +343,9 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
            (unpack_unreachable || (pack_everything & LOOSEN_UNREACHABLE)))
                die(_("--keep-unreachable and -A are incompatible"));
 
+       if (write_bitmaps < 0)
+               write_bitmaps = (pack_everything & ALL_INTO_ONE) &&
+                                is_bare_repository();
        if (pack_kept_objects < 0)
                pack_kept_objects = write_bitmaps;
 
@@ -419,7 +422,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
        if (!names.nr && !po_args.quiet)
                printf_ln(_("Nothing new to pack."));
 
-       close_all_packs(the_repository->objects);
+       close_object_store(the_repository->objects);
 
        /*
         * Ok we have prepared all new packfiles.