aboutsummaryrefslogtreecommitdiffstats
path: root/models/release.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-06-21 00:51:41 -0400
committerUnknown <joe2010xtmf@163.com>2014-06-21 00:51:41 -0400
commitad5ec45dd63aa2563d113e6a9ce31180246aa5f2 (patch)
treeb49f76a29faeec1bdf734375f91e5291acf09e53 /models/release.go
parent8bfa7ae7453e56191aa6f7de8067d5b6bb5a4a8b (diff)
downloadgitea-ad5ec45dd63aa2563d113e6a9ce31180246aa5f2.tar.gz
gitea-ad5ec45dd63aa2563d113e6a9ce31180246aa5f2.zip
Fix #165
Diffstat (limited to 'models/release.go')
-rw-r--r--models/release.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/models/release.go b/models/release.go
index 32e8c92cc4..3e1a78118c 100644
--- a/models/release.go
+++ b/models/release.go
@@ -43,7 +43,7 @@ func IsReleaseExist(repoId int64, tagName string) (bool, error) {
return false, nil
}
- return orm.Get(&Release{RepoId: repoId, LowerTagName: strings.ToLower(tagName)})
+ return x.Get(&Release{RepoId: repoId, LowerTagName: strings.ToLower(tagName)})
}
func createTag(gitRepo *git.Repository, rel *Release) error {
@@ -86,7 +86,7 @@ func CreateRelease(gitRepo *git.Repository, rel *Release) error {
return err
}
rel.LowerTagName = strings.ToLower(rel.TagName)
- _, err = orm.InsertOne(rel)
+ _, err = x.InsertOne(rel)
return err
}
@@ -100,13 +100,13 @@ func GetRelease(repoId int64, tagName string) (*Release, error) {
}
rel := &Release{RepoId: repoId, LowerTagName: strings.ToLower(tagName)}
- _, err = orm.Get(rel)
+ _, err = x.Get(rel)
return rel, err
}
// GetReleasesByRepoId returns a list of releases of repository.
func GetReleasesByRepoId(repoId int64) (rels []*Release, err error) {
- err = orm.Desc("created").Find(&rels, Release{RepoId: repoId})
+ err = x.Desc("created").Find(&rels, Release{RepoId: repoId})
return rels, err
}
@@ -141,6 +141,6 @@ func UpdateRelease(gitRepo *git.Repository, rel *Release) (err error) {
if err = createTag(gitRepo, rel); err != nil {
return err
}
- _, err = orm.Id(rel.Id).AllCols().Update(rel)
+ _, err = x.Id(rel.Id).AllCols().Update(rel)
return err
}