aboutsummaryrefslogtreecommitdiffstats
path: root/modules/doctor
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2022-08-09 11:22:24 +0800
committerGitHub <noreply@github.com>2022-08-09 11:22:24 +0800
commit75d96f4a0274c5b7566305d494c176e1a88b1589 (patch)
treed4dc134d9fea8f0f89f895e7bf30ec39146edf32 /modules/doctor
parent820031e556af9548aa07e4de2669ca52bd7f63cb (diff)
downloadgitea-75d96f4a0274c5b7566305d494c176e1a88b1589.tar.gz
gitea-75d96f4a0274c5b7566305d494c176e1a88b1589.zip
Refactor legacy git init (#20376)
* merge `CheckLFSVersion` into `InitFull` (renamed from `InitWithSyncOnce`) * remove the `Once` during git init, no data-race now * for doctor sub-commands, `InitFull` should only be called in initialization stage Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'modules/doctor')
-rw-r--r--modules/doctor/mergebase.go3
-rw-r--r--modules/doctor/misc.go4
2 files changed, 0 insertions, 7 deletions
diff --git a/modules/doctor/mergebase.go b/modules/doctor/mergebase.go
index 2da91cdcc3..46369290a1 100644
--- a/modules/doctor/mergebase.go
+++ b/modules/doctor/mergebase.go
@@ -30,9 +30,6 @@ func iteratePRs(ctx context.Context, repo *repo_model.Repository, each func(*rep
}
func checkPRMergeBase(ctx context.Context, logger log.Logger, autofix bool) error {
- if err := git.InitOnceWithSync(ctx); err != nil {
- return err
- }
numRepos := 0
numPRs := 0
numPRsUpdated := 0
diff --git a/modules/doctor/misc.go b/modules/doctor/misc.go
index 24175fcaf4..2d2bcb910d 100644
--- a/modules/doctor/misc.go
+++ b/modules/doctor/misc.go
@@ -190,10 +190,6 @@ func checkDaemonExport(ctx context.Context, logger log.Logger, autofix bool) err
}
func checkCommitGraph(ctx context.Context, logger log.Logger, autofix bool) error {
- if err := git.InitOnceWithSync(ctx); err != nil {
- return err
- }
-
numRepos := 0
numNeedUpdate := 0
numWritten := 0