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 efa631a commit 6e2aafdCopy full SHA for 6e2aafd
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"
@@ -215,6 +216,10 @@ func CreateRelease(ctx *context.APIContext) {
215
216
// "409":
217
// "$ref": "#/responses/error"
218
form := web.GetForm(ctx).(*api.CreateReleaseOption)
219
+ if ctx.Repo.Repository.IsEmpty {
220
+ ctx.Error(http.StatusUnprocessableEntity, "RepoIsEmpty", fmt.Errorf("repo is empty"))
221
+ return
222
+ }
223
rel, err := repo_model.GetRelease(ctx, ctx.Repo.Repository.ID, form.TagName)
224
if err != nil {
225
if !repo_model.IsErrReleaseNotExist(err) {
0 commit comments