mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-06-18 18:58:22 +08:00
Move get/set default branch from git package to gitrepo package to hide repopath (#29126)
This commit is contained in:
models/issues
modules
routers
services
context
mirror
repository
wiki
@ -681,7 +681,7 @@ func RepoAssignment(ctx *Context) context.CancelFunc {
|
||||
if len(ctx.Repo.Repository.DefaultBranch) > 0 && gitRepo.IsBranchExist(ctx.Repo.Repository.DefaultBranch) {
|
||||
ctx.Repo.BranchName = ctx.Repo.Repository.DefaultBranch
|
||||
} else {
|
||||
ctx.Repo.BranchName, _ = gitRepo.GetDefaultBranch()
|
||||
ctx.Repo.BranchName, _ = gitrepo.GetDefaultBranch(ctx, ctx.Repo.Repository)
|
||||
if ctx.Repo.BranchName == "" {
|
||||
// If it still can't get a default branch, fall back to default branch from setting.
|
||||
// Something might be wrong. Either site admin should fix the repo sync or Gitea should fix a potential bug.
|
||||
|
Reference in New Issue
Block a user