We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b059f4 commit b84303eCopy full SHA for b84303e
routers/api/v1/repo/release.go
@@ -4,6 +4,7 @@
4
package repo
5
6
import (
7
+ "fmt"
8
"net/http"
9
10
"code.gitea.io/gitea/models"
@@ -221,6 +222,10 @@ func CreateRelease(ctx *context.APIContext) {
221
222
// "409":
223
// "$ref": "#/responses/error"
224
form := web.GetForm(ctx).(*api.CreateReleaseOption)
225
+ if ctx.Repo.Repository.IsEmpty {
226
+ ctx.Error(http.StatusUnprocessableEntity, "RepoIsEmpty", fmt.Errorf("repo is empty"))
227
+ return
228
+ }
229
rel, err := repo_model.GetRelease(ctx, ctx.Repo.Repository.ID, form.TagName)
230
if err != nil {
231
if !repo_model.IsErrReleaseNotExist(err) {
0 commit comments