Skip to content

Commit d624e91

Browse files
authored
Support slashes in release tags (#12864) (#12882)
Backport #12864 Fix #12861 Signed-off-by: Andrew Thornton <[email protected]>
1 parent 62a3c84 commit d624e91

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

routers/repo/release.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func SingleRelease(ctx *context.Context) {
132132
writeAccess := ctx.Repo.CanWrite(models.UnitTypeReleases)
133133
ctx.Data["CanCreateRelease"] = writeAccess && !ctx.Repo.Repository.IsArchived
134134

135-
release, err := models.GetRelease(ctx.Repo.Repository.ID, ctx.Params("tag"))
135+
release, err := models.GetRelease(ctx.Repo.Repository.ID, ctx.Params("*"))
136136
if err != nil {
137137
if models.IsErrReleaseNotExist(err) {
138138
ctx.NotFound("GetRelease", err)

routers/routes/routes.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -814,9 +814,9 @@ func RegisterRoutes(m *macaron.Macaron) {
814814
m.Group("/:username/:reponame", func() {
815815
m.Group("/releases", func() {
816816
m.Get("/", repo.Releases)
817-
m.Get("/tag/:tag", repo.SingleRelease)
817+
m.Get("/tag/*", repo.SingleRelease)
818818
m.Get("/latest", repo.LatestRelease)
819-
}, repo.MustBeNotEmpty, context.RepoRef())
819+
}, repo.MustBeNotEmpty, context.RepoRefByType(context.RepoRefTag))
820820
m.Group("/releases", func() {
821821
m.Get("/new", repo.NewRelease)
822822
m.Post("/new", bindIgnErr(auth.NewReleaseForm{}), repo.NewReleasePost)

0 commit comments

Comments
 (0)