From 1c46d68abaf08890e10386b3af674233b4dda2d3 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 28 Jun 2014 23:56:41 +0800 Subject: bug fixed for message tag --- cmd/update.go | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'cmd/update.go') 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) } -- cgit v1.2.3