Code

git-gc: always use -A when manually repacking
authorBrandon Casey <drafnel@gmail.com>
Sat, 10 May 2008 04:01:56 +0000 (23:01 -0500)
committerJunio C Hamano <gitster@pobox.com>
Sun, 11 May 2008 18:26:02 +0000 (11:26 -0700)
Now that repack -A will leave unreferenced objects unpacked, there is
no reason to use the -a option to repack (which will discard unreferenced
objects). The unpacked unreferenced objects will not be repacked by a
subsequent repack, and will eventually be pruned by git-gc based on the
gc.pruneExpire config option.

builtin-gc.c

index f99ebc7926b95b04f1140d257da7a52bfc33ee50..6db2f513b78c9f47a54c9bfdbf21df105b4c46ab 100644 (file)
@@ -256,17 +256,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
                        "performance. You may also\n"
                        "run \"git gc\" manually. See "
                        "\"git help gc\" for more information.\n");
-       } else {
-               /*
-                * Use safer (for shared repos) "-A" option to
-                * repack when not pruning. Auto-gc makes its
-                * own decision.
-                */
-               if (prune)
-                       append_option(argv_repack, "-a", MAX_ADD);
-               else
-                       append_option(argv_repack, "-A", MAX_ADD);
-       }
+       } else
+               append_option(argv_repack, "-A", MAX_ADD);
 
        if (pack_refs && run_command_v_opt(argv_pack_refs, RUN_GIT_CMD))
                return error(FAILED_RUN, argv_pack_refs[0]);