aboutsummaryrefslogtreecommitdiff
path: root/models/update.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/update.go')
-rw-r--r--models/update.go38
1 files changed, 3 insertions, 35 deletions
diff --git a/models/update.go b/models/update.go
index 18d6c9dc..507150be 100644
--- a/models/update.go
+++ b/models/update.go
@@ -15,38 +15,6 @@ import (
git "github.com/gogits/git-module"
)
-type UpdateTask struct {
- ID int64 `xorm:"pk autoincr"`
- UUID string `xorm:"index"`
- RefName string
- OldCommitID string
- NewCommitID string
-}
-
-func AddUpdateTask(task *UpdateTask) error {
- _, err := x.Insert(task)
- return err
-}
-
-// GetUpdateTaskByUUID returns update task by given UUID.
-func GetUpdateTaskByUUID(uuid string) (*UpdateTask, error) {
- task := &UpdateTask{
- UUID: uuid,
- }
- has, err := x.Get(task)
- if err != nil {
- return nil, err
- } else if !has {
- return nil, ErrUpdateTaskNotExist{uuid}
- }
- return task, nil
-}
-
-func DeleteUpdateTaskByUUID(uuid string) error {
- _, err := x.Delete(&UpdateTask{UUID: uuid})
- return err
-}
-
// CommitToPushCommit transforms a git.Commit to PushCommit type.
func CommitToPushCommit(commit *git.Commit) *PushCommit {
return &PushCommit{
@@ -74,13 +42,13 @@ func ListToPushCommits(l *list.List) *PushCommits {
}
type PushUpdateOptions struct {
+ OldCommitID string
+ NewCommitID string
+ RefFullName string
PusherID int64
PusherName string
RepoUserName string
RepoName string
- RefFullName string
- OldCommitID string
- NewCommitID string
}
// PushUpdate must be called for any push actions in order to