aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2022-10-15 16:40:32 +0200
committerGitHub <noreply@github.com>2022-10-15 16:40:32 +0200
commita33ff822ffc84b0d99d122ca9dabfedc583e9f8c (patch)
tree4b5b2af3c3d19e745aea52767ef05b07ad1d46e4 /routers/web/repo
parent677af6ac57295a9e8795a8ab3f29e284f2247fb6 (diff)
downloadgitea-a33ff822ffc84b0d99d122ca9dabfedc583e9f8c.tar.gz
gitea-a33ff822ffc84b0d99d122ca9dabfedc583e9f8c.zip
[refactor] Use const for wiki DefaultBranch (#21466)
just a nit, that will make it easier to change things and we now have a single source of truth
Diffstat (limited to 'routers/web/repo')
-rw-r--r--routers/web/repo/wiki.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/web/repo/wiki.go b/routers/web/repo/wiki.go
index 0f349547cd..a10e12ee63 100644
--- a/routers/web/repo/wiki.go
+++ b/routers/web/repo/wiki.go
@@ -99,7 +99,7 @@ func findWikiRepoCommit(ctx *context.Context) (*git.Repository, *git.Commit, err
return nil, nil, err
}
- commit, err := wikiRepo.GetBranchCommit("master")
+ commit, err := wikiRepo.GetBranchCommit(wiki_service.DefaultBranch)
if err != nil {
return wikiRepo, nil, err
}
@@ -302,7 +302,7 @@ func renderViewPage(ctx *context.Context) (*git.Repository, *git.TreeEntry) {
ctx.Data["toc"] = rctx.TableOfContents
// get commit count - wiki revisions
- commitsCount, _ := wikiRepo.FileCommitsCount("master", pageFilename)
+ commitsCount, _ := wikiRepo.FileCommitsCount(wiki_service.DefaultBranch, pageFilename)
ctx.Data["CommitCount"] = commitsCount
return wikiRepo, entry
@@ -351,7 +351,7 @@ func renderRevisionPage(ctx *context.Context) (*git.Repository, *git.TreeEntry)
ctx.Data["footerContent"] = ""
// get commit count - wiki revisions
- commitsCount, _ := wikiRepo.FileCommitsCount("master", pageFilename)
+ commitsCount, _ := wikiRepo.FileCommitsCount(wiki_service.DefaultBranch, pageFilename)
ctx.Data["CommitCount"] = commitsCount
// get page
@@ -361,7 +361,7 @@ func renderRevisionPage(ctx *context.Context) (*git.Repository, *git.TreeEntry)
}
// get Commit Count
- commitsHistory, err := wikiRepo.CommitsByFileAndRange("master", pageFilename, page)
+ commitsHistory, err := wikiRepo.CommitsByFileAndRange(wiki_service.DefaultBranch, pageFilename, page)
if err != nil {
if wikiRepo != nil {
wikiRepo.Close()