mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-23 19:47:07 +09:00
fix(git): leave reflog expiry to git's defaults (#39703)
Gitea's default `gc.reflogExpire = 90` is parsed by git as `1990-<month>-<day>`, currently `1990-10-09`, so reachable reflog entries never expired. Since git 2.54, auto maintenance runs its reflog-expire task in the foreground of every push, and its trigger ignores reachability, so busy repos rerun `git reflog expire --all` on every push without pruning anything, stalling large repos for over a minute. - Stop setting `gc.reflogExpire` so git's own defaults apply, and remove the `90` written by earlier versions - Treat the legacy `[git.reflog] EXPIRATION` as days, as documented The next push to each repo prunes the accumulated entries once. Fixes: https://github.com/go-gitea/gitea/issues/39693
This commit is contained in:
1 parent
39ae5d6e6b
commit
251e697b0a
5 files changed
+13
-8
No files matched your search
@@ -119,6 +119,11 @@ func syncGitConfig(ctx context.Context) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
// Gitea used to write "90", which git reads as a date in 1990
|
||||
if err := configUnsetAll(ctx, "gc.reflogExpire", "90"); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Apply user's git config options last so they take precedence over builtin defaults
|
||||
for k, v := range setting.GitConfig.Options {
|
||||
if err = configSet(ctx, strings.ToLower(k), v); err != nil {
|
||||
|
||||
Reference in new issue
Block a user