diff options
Diffstat (limited to 'routers')
-rw-r--r-- | routers/api/v1/repo/release.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/routers/api/v1/repo/release.go b/routers/api/v1/repo/release.go index 3c51e452f2..e622acb30c 100644 --- a/routers/api/v1/repo/release.go +++ b/routers/api/v1/repo/release.go @@ -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, |