Browse Source

repo/settings/branches: add prompt for bare repository

pull/4353/head
Unknwon 8 years ago
parent
commit
73de9f9d6a
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
  1. 1
      conf/locale/locale_en-US.ini
  2. 4
      modules/bindata/bindata.go
  3. 6
      routers/repo/setting.go

1
conf/locale/locale_en-US.ini

@ -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

4
modules/bindata/bindata.go

File diff suppressed because one or more lines are too long

6
routers/repo/setting.go

@ -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…
Cancel
Save