mirror of https://github.com/gogs/gogs.git
repo/settings/branches: add prompt for bare repository
parent
f40eb9774e
commit
73de9f9d6a
|
@ -658,6 +658,7 @@ settings.collaboration.write = Write
|
|||
settings.collaboration.read = Read
|
||||
settings.collaboration.undefined = Undefined
|
||||
settings.branches = Branches
|
||||
settings.branches_bare = You cannot manage branches for bare repository. Please push some content first.
|
||||
settings.default_branch = Default Branch
|
||||
settings.default_branch_desc = The default branch is considered the "base" branch for code commits, pull requests and online editing.
|
||||
settings.update = Update
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -370,6 +370,12 @@ func SettingsBranches(ctx *context.Context) {
|
|||
ctx.Data["Title"] = ctx.Tr("repo.settings.branches")
|
||||
ctx.Data["PageIsSettingsBranches"] = true
|
||||
|
||||
if ctx.Repo.Repository.IsBare {
|
||||
ctx.Flash.Info(ctx.Tr("repo.settings.branches_bare"), true)
|
||||
ctx.HTML(200, SETTINGS_BRANCHES)
|
||||
return
|
||||
}
|
||||
|
||||
protectBranches, err := models.GetProtectBranchesByRepoID(ctx.Repo.Repository.ID)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "GetProtectBranchesByRepoID", err)
|
||||
|
|
Loading…
Reference in New Issue