diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-01-13 23:09:24 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-01-13 23:09:24 -0800 |
commit | 08541563f468b41f08fe91854fc6530f075542d8 (patch) | |
tree | 80488388ae39d908d50c45b736b043e283266ec6 | |
parent | Merge branch 'cb/maint-unpack-trees-absense' (diff) | |
parent | objects to be pruned immediately don't have to be loosened (diff) | |
download | tgif-08541563f468b41f08fe91854fc6530f075542d8.tar.xz |
Merge branch 'np/no-loosen-prune-expire-now'
* np/no-loosen-prune-expire-now:
objects to be pruned immediately don't have to be loosened
-rw-r--r-- | Documentation/config.txt | 4 | ||||
-rw-r--r-- | builtin-gc.c | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt index 7408bb2d34..ea0cd97b04 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -702,7 +702,9 @@ gc.packrefs:: gc.pruneexpire:: When 'git-gc' is run, it will call 'prune --expire 2.weeks.ago'. - Override the grace period with this config variable. + Override the grace period with this config variable. The value + "now" may be used to disable this grace period and always prune + unreachable objects immediately. gc.reflogexpire:: 'git-reflog expire' removes reflog entries older than diff --git a/builtin-gc.c b/builtin-gc.c index 781df601c5..f8eae4adb4 100644 --- a/builtin-gc.c +++ b/builtin-gc.c @@ -188,7 +188,9 @@ static int need_to_gc(void) * there is no need. */ if (too_many_packs()) - append_option(argv_repack, "-A", MAX_ADD); + append_option(argv_repack, + !strcmp(prune_expire, "now") ? "-a" : "-A", + MAX_ADD); else if (!too_many_loose_objects()) return 0; @@ -243,7 +245,9 @@ int cmd_gc(int argc, const char **argv, const char *prefix) "run \"git gc\" manually. See " "\"git help gc\" for more information.\n"); } else - append_option(argv_repack, "-A", MAX_ADD); + append_option(argv_repack, + !strcmp(prune_expire, "now") ? "-a" : "-A", + MAX_ADD); if (pack_refs && run_command_v_opt(argv_pack_refs, RUN_GIT_CMD)) return error(FAILED_RUN, argv_pack_refs[0]); |