mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-05 12:29:05 +02: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:
1 parent
8b5f6ced22
commit
fada6968a8
11 files changed
+168
-348
No files matched your search
@@ -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