@matheusbsbs / matheus-bagliano / commits / a37cce3b23
Fork 0

git-gc: always use -A when manually repacking

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.

Brandon Casey committed May 9, 2008 at 23:01 UTC a37cce3b23afa2c88baa2f1369c585e05bcf4526
1 file changed +2 -11
builtin-gc.c
+2 -11
@@ -256,17 +256,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
256 "performance. You may also\n"
257 "run \"git gc\" manually. See "
258 "\"git help gc\" for more information.\n");
259 - } else {
260 - /*
261 - * Use safer (for shared repos) "-A" option to
262 - * repack when not pruning. Auto-gc makes its
263 - * own decision.
264 - */
265 - if (prune)
266 - append_option(argv_repack, "-a", MAX_ADD);
267 - else
268 - append_option(argv_repack, "-A", MAX_ADD);
269 - }
259 + } else
260 + append_option(argv_repack, "-A", MAX_ADD);
261
262 if (pack_refs && run_command_v_opt(argv_pack_refs, RUN_GIT_CMD))
263 return error(FAILED_RUN, argv_pack_refs[0]);