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
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user