summaryrefslogtreecommitdiffstats
path: root/modules/context
diff options
context:
space:
mode:
authorJason Song <i@wolfogre.com>2022-10-03 20:05:53 +0800
committerGitHub <noreply@github.com>2022-10-03 20:05:53 +0800
commita08b48454970a0639039b730cbe616686e82bc0f (patch)
treee1e99706522b35ebab854c91a8a2a51adc56304a /modules/context
parentaf849ac00965ed3e2722ed89309da4c353fd9bee (diff)
downloadgitea-a08b48454970a0639039b730cbe616686e82bc0f.tar.gz
gitea-a08b48454970a0639039b730cbe616686e82bc0f.zip
Tag list should include draft releases with existing tags (#21263)
Before, a tag for a draft release disappeared in the tag list, fix #21262. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'modules/context')
-rw-r--r--modules/context/repo.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/context/repo.go b/modules/context/repo.go
index 6a336c45f7..1742683d3c 100644
--- a/modules/context/repo.go
+++ b/modules/context/repo.go
@@ -524,7 +524,9 @@ func RepoAssignment(ctx *Context) (cancel context.CancelFunc) {
}
ctx.Data["NumTags"], err = repo_model.GetReleaseCountByRepoID(ctx.Repo.Repository.ID, repo_model.FindReleasesOptions{
- IncludeTags: true,
+ IncludeDrafts: true,
+ IncludeTags: true,
+ HasSha1: util.OptionalBoolTrue, // only draft releases which are created with existing tags
})
if err != nil {
ctx.ServerError("GetReleaseCountByRepoID", err)