mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 11:52:10 +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:
parent
8b5f6ced22
commit
fada6968a8
11 changed files with 168 additions and 348 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue