summaryrefslogtreecommitdiffstats
path: root/models/release.go
diff options
context:
space:
mode:
authorslene <vslene@gmail.com>2014-05-10 11:14:24 +0800
committerslene <vslene@gmail.com>2014-05-10 11:14:24 +0800
commit7d84cc96e8da9f7389f855be4f86864039843e6c (patch)
tree01e490472f6c9448b930727dc2c83c78c058f5f2 /models/release.go
parent2eabeba6b76d906664defe4392a7ca2640128712 (diff)
downloadgitea-7d84cc96e8da9f7389f855be4f86864039843e6c.tar.gz
gitea-7d84cc96e8da9f7389f855be4f86864039843e6c.zip
update with git api
Diffstat (limited to 'models/release.go')
-rw-r--r--models/release.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/models/release.go b/models/release.go
index 1df6272029..e6c3d56152 100644
--- a/models/release.go
+++ b/models/release.go
@@ -50,7 +50,7 @@ func IsReleaseExist(repoId int64, tagName string) (bool, error) {
}
// CreateRelease creates a new release of repository.
-func CreateRelease(repoPath string, rel *Release, gitRepo *git.Repository) error {
+func CreateRelease(gitRepo *git.Repository, rel *Release) error {
isExist, err := IsReleaseExist(rel.RepoId, rel.TagName)
if err != nil {
return err
@@ -58,8 +58,8 @@ func CreateRelease(repoPath string, rel *Release, gitRepo *git.Repository) error
return ErrReleaseAlreadyExist
}
- if !git.IsTagExist(repoPath, rel.TagName) {
- _, stderr, err := com.ExecCmdDir(repoPath, "git", "tag", rel.TagName, "-m", rel.Title)
+ if !gitRepo.IsTagExist(rel.TagName) {
+ _, stderr, err := com.ExecCmdDir(gitRepo.Path, "git", "tag", rel.TagName, "-m", rel.Title)
if err != nil {
return err
} else if strings.Contains(stderr, "fatal:") {