1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-09 20:17:21 +00:00

Validate that the tag doesn't exist when creating a tag via the web (#33241)

Found while investigating #33210.

This line no longer makes sense because the form field "TagName" is
required, so this would mean that this code path would never be covered.
Because it isn't covered, we end up going down the "update release"
logic where we eventually set `Release.IsTag` to false (meaning it will
now be treated as a release instead of a tag).

This snapshot rewrites the condition to ensure that we aren't trying to
create a tag that already exists.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Kemal Zebari
2025-01-13 17:27:35 -08:00
committed by GitHub
parent 58ac17c005
commit ecd463c2f1
5 changed files with 243 additions and 172 deletions

View File

@ -39,7 +39,7 @@ func createNewRelease(t *testing.T, session *TestSession, repoURL, tag, title st
postData["prerelease"] = "on"
}
if draft {
postData["draft"] = "Save Draft"
postData["draft"] = "1"
}
req = NewRequestWithValues(t, "POST", link, postData)