Pārlūkot izejas kodu

repo/settings/branches: add prompt for bare repository

Unknwon 7 gadi atpakaļ
vecāks
revīzija
73de9f9d6a

+ 1 - 0
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

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
modules/bindata/bindata.go


+ 6 - 0
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)

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels