1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Avoid showing Failed to change the default wiki branch if repo has no wiki when saving repo settings (#30329)

This commit is contained in:
yp05327
2024-04-08 20:43:23 +09:00
committed by GitHub
parent 074a3e05f6
commit 7d66b9ea65
2 changed files with 10 additions and 0 deletions

View File

@@ -370,6 +370,10 @@ func ChangeDefaultWikiBranch(ctx context.Context, repo *repo_model.Repository, n
return fmt.Errorf("unable to update database: %w", err)
}
if !repo.HasWiki() {
return nil
}
oldDefBranch, err := gitrepo.GetWikiDefaultBranch(ctx, repo)
if err != nil {
return fmt.Errorf("unable to get default branch: %w", err)