summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-04-08 06:04:19 +0100
committerGitHub <noreply@github.com>2020-04-08 02:04:19 -0300
commit089b34858ce1ce3101b13fa8e14e4e56e0a02a90 (patch)
tree4d2b40150a41f1f86c56778e86a25b7143670796
parent3d63caa54245d87dd057d4e853bb5dc7fc39e7db (diff)
downloadgitea-089b34858ce1ce3101b13fa8e14e4e56e0a02a90.tar.gz
gitea-089b34858ce1ce3101b13fa8e14e4e56e0a02a90.zip
Return error for authorized_keys and mergebase problems (#10990)
Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
-rw-r--r--cmd/doctor.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/doctor.go b/cmd/doctor.go
index 3b0b5c9e9f..f469496cfd 100644
--- a/cmd/doctor.go
+++ b/cmd/doctor.go
@@ -353,7 +353,7 @@ func runDoctorAuthorizedKeys(ctx *cli.Context) ([]string, error) {
if ctx.Bool("fix") {
return []string{"authorized_keys is out of date, attempting regeneration"}, models.RewriteAllPublicKeys()
}
- return []string{"authorized_keys is out of date and should be regenerated with gitea admin regenerate keys"}, nil
+ return nil, fmt.Errorf(`authorized_keys is out of date and should be regenerated with "gitea admin regenerate keys" or "gitea doctor --run authorized_keys --fix"`)
}
return nil, nil
}
@@ -479,6 +479,9 @@ func runDoctorPRMergeBase(ctx *cli.Context) ([]string, error) {
if ctx.Bool("fix") {
results = append(results, fmt.Sprintf("%d PR mergebases updated of %d PRs total in %d repos", numPRsUpdated, numPRs, numRepos))
} else {
+ if numPRsUpdated > 0 && err == nil {
+ return results, fmt.Errorf("%d PRs with incorrect mergebases of %d PRs total in %d repos", numPRsUpdated, numPRs, numRepos)
+ }
results = append(results, fmt.Sprintf("%d PRs with incorrect mergebases of %d PRs total in %d repos", numPRsUpdated, numPRs, numRepos))
}