Skip to content

Commit 38dbcf8

Browse files
committed
fix
1 parent 6708343 commit 38dbcf8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

routers/web/repo/release.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ func NewRelease(ctx *context.Context) {
381381

382382
ctx.Data["ShowCreateTagOnlyButton"] = false
383383
ctx.Data["tag_name"] = rel.TagName
384-
ctx.Data["tag_target"] = rel.Target
384+
ctx.Data["tag_target"] = util.IfZero(rel.Target, ctx.Repo.Repository.DefaultBranch)
385385
ctx.Data["title"] = rel.Title
386386
ctx.Data["content"] = rel.Note
387387
ctx.Data["attachments"] = rel.Attachments
@@ -537,7 +537,7 @@ func EditRelease(ctx *context.Context) {
537537
}
538538
ctx.Data["ID"] = rel.ID
539539
ctx.Data["tag_name"] = rel.TagName
540-
ctx.Data["tag_target"] = rel.Target
540+
ctx.Data["tag_target"] = util.IfZero(rel.Target, ctx.Repo.Repository.DefaultBranch)
541541
ctx.Data["title"] = rel.Title
542542
ctx.Data["content"] = rel.Note
543543
ctx.Data["prerelease"] = rel.IsPrerelease
@@ -583,7 +583,7 @@ func EditReleasePost(ctx *context.Context) {
583583
return
584584
}
585585
ctx.Data["tag_name"] = rel.TagName
586-
ctx.Data["tag_target"] = rel.Target
586+
ctx.Data["tag_target"] = util.IfZero(rel.Target, ctx.Repo.Repository.DefaultBranch)
587587
ctx.Data["title"] = rel.Title
588588
ctx.Data["content"] = rel.Note
589589
ctx.Data["prerelease"] = rel.IsPrerelease

0 commit comments

Comments
 (0)