mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-06 21:07:06 +02:00
Move get/set default branch from git package to gitrepo package to hide repopath (#29126)
This commit is contained in:
1 parent
a1f5dd7677
commit
25b842df26
15 files changed
+52
-63
No files matched your search
@@ -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