Fix #197
This commit is contained in:
parent
1161c71ac1
commit
9961f9a53c
4 changed files with 22 additions and 9 deletions
|
@ -79,7 +79,7 @@ func Releases(ctx *middleware.Context) {
|
|||
tags.rels[i] = &models.Release{
|
||||
Title: rawTag,
|
||||
TagName: rawTag,
|
||||
SHA1: commit.Id.String(),
|
||||
Sha1: commit.Id.String(),
|
||||
}
|
||||
tags.rels[i].NumCommits, err = ctx.Repo.GitRepo.CommitsCount(commit.Id.String())
|
||||
if err != nil {
|
||||
|
@ -129,12 +129,18 @@ func ReleasesNewPost(ctx *middleware.Context, form auth.NewReleaseForm) {
|
|||
return
|
||||
}
|
||||
|
||||
if !ctx.Repo.GitRepo.IsBranchExist(form.Target) {
|
||||
ctx.RenderWithErr("Target branch does not exist", "release/new", &form)
|
||||
return
|
||||
}
|
||||
|
||||
rel := &models.Release{
|
||||
RepoId: ctx.Repo.Repository.Id,
|
||||
PublisherId: ctx.User.Id,
|
||||
Title: form.Title,
|
||||
TagName: form.TagName,
|
||||
SHA1: ctx.Repo.Commit.Id.String(),
|
||||
Target: form.Target,
|
||||
Sha1: ctx.Repo.Commit.Id.String(),
|
||||
NumCommits: commitsCount,
|
||||
Note: form.Content,
|
||||
IsPrerelease: form.Prerelease,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue