diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2014-06-28 23:56:41 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2014-06-28 23:56:41 +0800 |
commit | 1c46d68abaf08890e10386b3af674233b4dda2d3 (patch) | |
tree | ee366ead93743202b7a1d92936cbaaed76623867 /cmd/update.go | |
parent | 4ce2fa520a1d9c36febd19562015107b74a4bc1d (diff) | |
download | gitea-1c46d68abaf08890e10386b3af674233b4dda2d3.tar.gz gitea-1c46d68abaf08890e10386b3af674233b4dda2d3.zip |
bug fixed for message tag
Diffstat (limited to 'cmd/update.go')
-rw-r--r-- | cmd/update.go | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/cmd/update.go b/cmd/update.go index c030b6cfb2..551fd09ef3 100644 --- a/cmd/update.go +++ b/cmd/update.go @@ -6,10 +6,8 @@ package cmd import ( "os" - "strconv" "github.com/codegangsta/cli" - "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/log" ) @@ -37,12 +35,27 @@ func runUpdate(c *cli.Context) { log.GitLogger.Fatal("refName is empty, shouldn't use") } - userName := os.Getenv("userName") - userId, _ := strconv.ParseInt(os.Getenv("userId"), 10, 64) - repoUserName := os.Getenv("repoUserName") - repoName := os.Getenv("repoName") + //userName := os.Getenv("userName") + //userId, _ := strconv.ParseInt(os.Getenv("userId"), 10, 64) + //repoUserName := os.Getenv("repoUserName") + //repoName := os.Getenv("repoName") + uuid := os.Getenv("uuid") + + task := models.UpdateTask{ + Uuid: uuid, + RefName: args[0], + OldCommitId: args[1], + NewCommitId: args[2], + } + + log.GitLogger.Error("%v", task) - if err := models.Update(args[0], args[1], args[2], userName, repoUserName, repoName, userId); err != nil { + if err := models.AddUpdateTask(&task); err != nil { log.GitLogger.Fatal(err.Error()) } + + /*if err := models.Update(args[0], args[1], args[2], userName, repoUserName, repoName, userId); err != nil { + log.GitLogger.Fatal(err.Error()) + }*/ + //setEnvs(args[0], args[1], args[2], userName, repoUserName, repoName, userId) } |