mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Fix incorrect ref usages (#33301)
Fix #33297 By the way, improve some locales
This commit is contained in:
@@ -777,6 +777,18 @@ func repoRefFullName(typ git.RefType, shortName string) git.RefName {
|
||||
}
|
||||
}
|
||||
|
||||
func RepoRefByDefaultBranch() func(*Context) {
|
||||
return func(ctx *Context) {
|
||||
ctx.Repo.RefFullName = git.RefNameFromBranch(ctx.Repo.Repository.DefaultBranch)
|
||||
ctx.Repo.BranchName = ctx.Repo.Repository.DefaultBranch
|
||||
ctx.Repo.Commit, _ = ctx.Repo.GitRepo.GetBranchCommit(ctx.Repo.BranchName)
|
||||
ctx.Repo.CommitsCount, _ = ctx.Repo.GetCommitsCount()
|
||||
ctx.Data["RefFullName"] = ctx.Repo.RefFullName
|
||||
ctx.Data["BranchName"] = ctx.Repo.BranchName
|
||||
ctx.Data["CommitsCount"] = ctx.Repo.CommitsCount
|
||||
}
|
||||
}
|
||||
|
||||
// RepoRefByType handles repository reference name for a specific type
|
||||
// of repository reference
|
||||
func RepoRefByType(detectRefType git.RefType) func(*Context) {
|
||||
|
Reference in New Issue
Block a user