mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Fix new release creation API to allow empty target (#5870)
* Fix new release creation API to allow empty target * Add more test cases * Update swagger
This commit is contained in:
committed by
techknowlogick
parent
8b5f6ced22
commit
fada6968a8
@@ -152,6 +152,10 @@ func CreateRelease(ctx *context.APIContext, form api.CreateReleaseOption) {
|
||||
ctx.ServerError("GetRelease", err)
|
||||
return
|
||||
}
|
||||
// If target is not provided use default branch
|
||||
if len(form.Target) == 0 {
|
||||
form.Target = ctx.Repo.Repository.DefaultBranch
|
||||
}
|
||||
rel = &models.Release{
|
||||
RepoID: ctx.Repo.Repository.ID,
|
||||
PublisherID: ctx.User.ID,
|
||||
|
Reference in New Issue
Block a user