diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-02-27 13:57:15 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-02-27 13:57:15 -0800 |
commit | c96bc189b52dc6c4211d75d68b7fa7bd6ad0d630 (patch) | |
tree | 10b46aa902e6210862ed6ef586e86cd0d4660729 /t | |
parent | Merge branch 'jh/preload-index-skip-skip' (diff) | |
parent | gc: ignore old gc.log files (diff) | |
download | tgif-c96bc189b52dc6c4211d75d68b7fa7bd6ad0d630.tar.xz |
Merge branch 'dt/gc-ignore-old-gc-logs'
A "gc.log" file left by a backgrounded "gc --auto" disables further
automatic gc; it has been taught to run at least once a day (by
default) by ignoring a stale "gc.log" file that is too old.
* dt/gc-ignore-old-gc-logs:
gc: ignore old gc.log files
Diffstat (limited to 't')
-rwxr-xr-x | t/t6500-gc.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t6500-gc.sh b/t/t6500-gc.sh index 1762dfa6a3..08de2e8ab0 100755 --- a/t/t6500-gc.sh +++ b/t/t6500-gc.sh @@ -67,5 +67,20 @@ test_expect_success 'auto gc with too many loose objects does not attempt to cre test_line_count = 2 new # There is one new pack and its .idx ' +test_expect_success 'background auto gc does not run if gc.log is present and recent but does if it is old' ' + test_commit foo && + test_commit bar && + git repack && + test_config gc.autopacklimit 1 && + test_config gc.autodetach true && + echo fleem >.git/gc.log && + test_must_fail git gc --auto 2>err && + test_i18ngrep "^error:" err && + test_config gc.logexpiry 5.days && + test-chmtime =-345600 .git/gc.log && + test_must_fail git gc --auto && + test_config gc.logexpiry 2.days && + git gc --auto +' test_done |