Skip to content

Commit 680aee4

Browse files
committed
remove dead code and fix lint
1 parent ca5bfa6 commit 680aee4

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

routers/web/repo/release.go

-6
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,6 @@ func Releases(ctx *context.Context) {
152152
ctx.Data["Title"] = ctx.Tr("repo.release.releases")
153153
ctx.Data["IsViewBranch"] = false
154154
ctx.Data["IsViewTag"] = true
155-
// Disable the showCreateNewBranch form in the dropdown on this page.
156-
ctx.Data["CanCreateBranch"] = false
157-
ctx.Data["HideBranchesInDropdown"] = true
158155

159156
listOptions := db.ListOptions{
160157
Page: ctx.FormInt("page"),
@@ -201,9 +198,6 @@ func TagsList(ctx *context.Context) {
201198
ctx.Data["Title"] = ctx.Tr("repo.release.tags")
202199
ctx.Data["IsViewBranch"] = false
203200
ctx.Data["IsViewTag"] = true
204-
// Disable the showCreateNewBranch form in the dropdown on this page.
205-
ctx.Data["CanCreateBranch"] = false
206-
ctx.Data["HideBranchesInDropdown"] = true
207201
ctx.Data["CanCreateRelease"] = ctx.Repo.CanWrite(unit.TypeReleases) && !ctx.Repo.Repository.IsArchived
208202

209203
namePattern := ctx.FormTrim("q")

routers/web/repo/view_file.go

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright 2024 The Gitea Authors. All rights reserved.
2+
// SPDX-License-Identifier: MIT
3+
14
package repo
25

36
import (

routers/web/repo/view_home.go

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright 2024 The Gitea Authors. All rights reserved.
2+
// SPDX-License-Identifier: MIT
3+
14
package repo
25

36
import (

routers/web/repo/view_readme.go

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright 2024 The Gitea Authors. All rights reserved.
2+
// SPDX-License-Identifier: MIT
3+
14
package repo
25

36
import (

services/context/repo.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ func RepoRefByType(detectRefType RepoRefType, opts ...RepoRefByTypeOptions) func
10291029
ctx.Data["IsViewBranch"] = ctx.Repo.IsViewBranch
10301030
ctx.Data["IsViewTag"] = ctx.Repo.IsViewTag
10311031
ctx.Data["IsViewCommit"] = ctx.Repo.IsViewCommit
1032-
ctx.Data["CanCreateBranch"] = ctx.Repo.CanCreateBranch()
1032+
ctx.Data["CanCreateBranch"] = ctx.Repo.CanCreateBranch() // only used by the branch selector dropdown: AllowCreateNewRef
10331033

10341034
ctx.Repo.CommitsCount, err = ctx.Repo.GetCommitsCount()
10351035
if err != nil {

0 commit comments

Comments
 (0)