mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-03 21:08:25 +00:00 
			
		
		
		
	[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
This commit is contained in:
		@@ -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()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user