debug: add error logging to OrgWikiRepoExists
Generic: Repo Health / Site Health (push) Has been skipped
Generic: Repo Health / Access control (push) Successful in 3s
Generic: Project CI / Lint & Validate (push) Successful in 43s
Deploy MokoGitea / deploy (push) Failing after 45s
Generic: Project CI / Tests (push) Has been cancelled
Generic: Repo Health / Scripts governance (push) Has been cancelled
Generic: Repo Health / Repository health (push) Has been cancelled
Generic: Repo Health / Report Issues (push) Has been cancelled

This commit is contained in:
Jonathan Miller
2026-06-09 16:16:51 -05:00
parent be6f3091af
commit 47ac97d284
+9 -3
View File
@@ -213,9 +213,15 @@ func loadHeaderCount(ctx *context.Context) error {
func OrgWikiRepoExists(ctx *context.Context, ownerID int64, repoName string) bool {
dbRepo, err := repo_model.GetRepositoryByName(ctx, ownerID, repoName)
if err != nil {
log.Trace("OrgWikiRepoExists: repo %s not found for owner %d: %v", repoName, ownerID, err)
return false
}
// Check if the wiki sidecar repo exists by trying to get its default branch.
_, err = gitrepo.GetDefaultBranch(ctx, dbRepo.WikiStorageRepo())
return err == nil
wikiRepo := dbRepo.WikiStorageRepo()
_, err = gitrepo.GetDefaultBranch(ctx, wikiRepo)
if err != nil {
log.Error("OrgWikiRepoExists: GetDefaultBranch for wiki of %s failed: %v (path: %s)", dbRepo.FullName(), err, wikiRepo.RelativePath())
return false
}
log.Trace("OrgWikiRepoExists: wiki found for %s", dbRepo.FullName())
return true
}