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) (#30337)
Backport #30329 by @yp05327 If repo does not have wiki, we should return after save the default wiki branch into DB. Or you will always see `Failed to change the default wiki branch` error. Co-authored-by: yp05327 <576951401@qq.com>
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user