diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-03-22 01:03:28 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-22 01:03:28 +0300 |
commit | d30ec1bece7f56080bac3e5a9f8dbc9f80508fdb (patch) | |
tree | 4f8652659fcc58feb2636dcf387832a63faa73ae /t | |
parent | f4470f2db0b15ae14408dcb3b5365aac550ef41e (diff) | |
parent | a831c06a2b639b0f862297672973bef965c7ffcd (diff) |
Merge branch 'dt/gc-ignore-old-gc-logs' into maint
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 |