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 authored and GitHub committed 2024-04-08 19:43:23 +08:00
1 parent 074a3e05f6
commit 7d66b9ea65
2 files changed
+10

No files matched your search

+4
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)