aboutsummaryrefslogtreecommitdiffstats
path: root/modules/doctor/mergebase.go
diff options
context:
space:
mode:
authorGusted <williamzijl7@hotmail.com>2022-05-31 18:49:40 +0000
committerGitHub <noreply@github.com>2022-05-31 14:49:40 -0400
commit0e516949a446f509411bcd7b2654a048d37a91c5 (patch)
tree56a97c43715eb9f92e738302551bbbb46a5a2dfb /modules/doctor/mergebase.go
parent40e87d031f60bab8f48d9f0ca91450f8e28b6fbd (diff)
downloadgitea-0e516949a446f509411bcd7b2654a048d37a91c5.tar.gz
gitea-0e516949a446f509411bcd7b2654a048d37a91c5.zip
Fix inconsistency in doctor output (#19836)
* Fix inconsistency in doctor output - Use `logger.Info` instead of `logger.Warn` when no errors were found. * Update modules/doctor/fix16961.go Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'modules/doctor/mergebase.go')
-rw-r--r--modules/doctor/mergebase.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/doctor/mergebase.go b/modules/doctor/mergebase.go
index 8f5c61a5da..61ee9e212b 100644
--- a/modules/doctor/mergebase.go
+++ b/modules/doctor/mergebase.go
@@ -92,12 +92,14 @@ func checkPRMergeBase(ctx context.Context, logger log.Logger, autofix bool) erro
if autofix {
logger.Info("%d PR mergebases updated of %d PRs total in %d repos", numPRsUpdated, numPRs, numRepos)
} else {
- if numPRsUpdated > 0 && err == nil {
+ if numPRsUpdated == 0 {
+ logger.Info("All %d PRs in %d repos have a correct mergebase", numPRs, numRepos)
+ } else if err == nil {
logger.Critical("%d PRs with incorrect mergebases of %d PRs total in %d repos", numPRsUpdated, numPRs, numRepos)
return fmt.Errorf("%d PRs with incorrect mergebases of %d PRs total in %d repos", numPRsUpdated, numPRs, numRepos)
+ } else {
+ logger.Warn("%d PRs with incorrect mergebases of %d PRs total in %d repos", numPRsUpdated, numPRs, numRepos)
}
-
- logger.Warn("%d PRs with incorrect mergebases of %d PRs total in %d repos", numPRsUpdated, numPRs, numRepos)
}
return err