Skip to content

Commit 625757c

Browse files
committed
temp fix
1 parent 5191149 commit 625757c

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

routers/web/web.go

+3-5
Original file line numberDiff line numberDiff line change
@@ -1336,11 +1336,9 @@ func registerRoutes(m *web.Router) {
13361336
m.Get("/list", repo.GetTagList)
13371337
m.Get(".rss", feedEnabled, repo.TagsListFeedRSS)
13381338
m.Get(".atom", feedEnabled, repo.TagsListFeedAtom)
1339-
}, ctxDataSet("EnableFeed", setting.Other.EnableFeed),
1340-
repo.MustBeNotEmpty, context.RepoRefByType(git.RefTypeTag, context.RepoRefByTypeOptions{IgnoreNotExistErr: true}))
1341-
m.Post("/tags/delete", repo.DeleteTag, reqSignIn,
1342-
repo.MustBeNotEmpty, context.RepoMustNotBeArchived(), reqRepoCodeWriter, context.RepoRef())
1343-
}, optSignIn, context.RepoAssignment, reqUnitCodeReader)
1339+
}, ctxDataSet("EnableFeed", setting.Other.EnableFeed))
1340+
m.Post("/tags/delete", reqSignIn, reqRepoCodeWriter, context.RepoMustNotBeArchived(), repo.DeleteTag)
1341+
}, optSignIn, context.RepoAssignment, repo.MustBeNotEmpty, reqUnitCodeReader)
13441342
// end "/{username}/{reponame}": repo tags
13451343

13461344
m.Group("/{username}/{reponame}", func() { // repo releases

services/context/repo.go

+1-9
Original file line numberDiff line numberDiff line change
@@ -776,10 +776,6 @@ func getRefName(ctx *Base, repo *Repository, path string, refType git.RefType) s
776776
return ""
777777
}
778778

779-
type RepoRefByTypeOptions struct {
780-
IgnoreNotExistErr bool
781-
}
782-
783779
func repoRefFullName(typ git.RefType, shortName string) git.RefName {
784780
switch typ {
785781
case git.RefTypeBranch:
@@ -796,8 +792,7 @@ func repoRefFullName(typ git.RefType, shortName string) git.RefName {
796792

797793
// RepoRefByType handles repository reference name for a specific type
798794
// of repository reference
799-
func RepoRefByType(detectRefType git.RefType, opts ...RepoRefByTypeOptions) func(*Context) {
800-
opt := util.OptionalArg(opts)
795+
func RepoRefByType(detectRefType git.RefType) func(*Context) {
801796
return func(ctx *Context) {
802797
var err error
803798
refType := detectRefType
@@ -908,9 +903,6 @@ func RepoRefByType(detectRefType git.RefType, opts ...RepoRefByTypeOptions) func
908903
ctx.RespHeader().Set("Link", fmt.Sprintf(`<%s>; rel="canonical"`, canonicalURL))
909904
}
910905
} else {
911-
if opt.IgnoreNotExistErr {
912-
return
913-
}
914906
ctx.NotFound("RepoRef invalid repo", fmt.Errorf("branch or tag not exist: %s", refShortName))
915907
return
916908
}

0 commit comments

Comments
 (0)