|
|
@@ -4,6 +4,7 @@ |
|
|
|
package repo |
|
|
|
|
|
|
|
import ( |
|
|
|
"fmt" |
|
|
|
"net/http" |
|
|
|
|
|
|
|
"code.gitea.io/gitea/models" |
|
|
@@ -221,6 +222,10 @@ func CreateRelease(ctx *context.APIContext) { |
|
|
|
// "409": |
|
|
|
// "$ref": "#/responses/error" |
|
|
|
form := web.GetForm(ctx).(*api.CreateReleaseOption) |
|
|
|
if ctx.Repo.Repository.IsEmpty { |
|
|
|
ctx.Error(http.StatusUnprocessableEntity, "RepoIsEmpty", fmt.Errorf("repo is empty")) |
|
|
|
return |
|
|
|
} |
|
|
|
rel, err := repo_model.GetRelease(ctx, ctx.Repo.Repository.ID, form.TagName) |
|
|
|
if err != nil { |
|
|
|
if !repo_model.IsErrReleaseNotExist(err) { |