rebase: consolidate clean-up code before leaving reset_head()
[gitweb.git] / builtin / repack.c
index 0223f2880ceaec57d10aadb4fcce7a28ce670cc4..82c19b755509f83bf189dd70323a678c299c6b66 100644 (file)
@@ -550,6 +550,12 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
                if (!po_args.quiet && isatty(2))
                        opts |= PRUNE_PACKED_VERBOSE;
                prune_packed_objects(opts);
+
+               if (!keep_unreachable &&
+                   (!(pack_everything & LOOSEN_UNREACHABLE) ||
+                    unpack_unreachable) &&
+                   is_repository_shallow(the_repository))
+                       prune_shallow(PRUNE_QUICK);
        }
 
        if (!no_update_server_info)