Skip to content

Commit

Permalink
git-gc: always use -A when manually repacking
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Brandon Casey authored and Junio C Hamano committed May 11, 2008
1 parent ccc1297 commit a37cce3
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions builtin-gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit a37cce3

Please sign in to comment.