Skip to content

Commit ef3450a

Browse files
committed
fix error msg, only show branch to admin owner
1 parent f773de8 commit ef3450a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

services/wiki/wiki.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func InitWiki(ctx context.Context, repo *repo_model.Repository) error {
4343
} else if err = repo_module.CreateDelegateHooks(repo.WikiPath()); err != nil {
4444
return fmt.Errorf("createDelegateHooks: %w", err)
4545
} else if _, _, err = git.NewCommand(ctx, "symbolic-ref", "HEAD").AddDynamicArguments(git.BranchPrefix + repo.DefaultWikiBranch).RunStdString(&git.RunOpts{Dir: repo.WikiPath()}); err != nil {
46-
return fmt.Errorf("unable to set default wiki branch to master: %w", err)
46+
return fmt.Errorf("unable to set default wiki branch to %q: %w", repo.DefaultWikiBranch, err)
4747
}
4848
return nil
4949
}

templates/repo/wiki/pages.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
{{end}}
1111
</span>
1212
</h2>
13-
<div>{{ctx.Locale.Tr "repo.default_branch"}}: {{.Repository.DefaultWikiBranch}}</div>
13+
{{if .IsRepositoryAdmin}}<div>{{ctx.Locale.Tr "repo.default_branch"}}: {{.Repository.DefaultWikiBranch}}</div>{{end}}
1414
<table class="ui table wiki-pages-list">
1515
<tbody>
1616
{{range .Pages}}

0 commit comments

Comments
 (0)