fix release creation via API (#5076)

* fix release creation via API

* fix release create tests
This commit is contained in:
Lunny Xiao
2018-10-15 11:52:52 +08:00
committed by Lauris BH
parent 0cd8cecdf8
commit 970c690681
2 changed files with 98 additions and 2 deletions

View File

@ -115,9 +115,9 @@ func createTag(gitRepo *git.Repository, rel *Release) error {
// Only actual create when publish.
if !rel.IsDraft {
if !gitRepo.IsTagExist(rel.TagName) {
commit, err := gitRepo.GetBranchCommit(rel.Target)
commit, err := gitRepo.GetCommit(rel.Target)
if err != nil {
return fmt.Errorf("GetBranchCommit: %v", err)
return fmt.Errorf("GetCommit: %v", err)
}
// Trim '--' prefix to prevent command line argument vulnerability.