aboutsummaryrefslogtreecommitdiff
path: root/update.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2014-03-16 22:32:50 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2014-03-16 22:32:50 +0800
commitf824d6a4b11d4d8ddc82d54c5183934b465afbd3 (patch)
tree3586b1746fd2097834685e0ee589de7b1a0c10b0 /update.go
parentf620f23c35f76a97f945f210638d4be8920e189e (diff)
parent9557cfc6534d2a215f6c6da73468aea1e3edd61f (diff)
Merge branch 'master' of github.com:gogits/gogs
Diffstat (limited to 'update.go')
-rw-r--r--update.go27
1 files changed, 20 insertions, 7 deletions
diff --git a/update.go b/update.go
index 339b3ab9..477989e8 100644
--- a/update.go
+++ b/update.go
@@ -1,13 +1,19 @@
+// Copyright 2014 The Gogs Authors. All rights reserved.
+// Use of this source code is governed by a MIT-style
+// license that can be found in the LICENSE file.
+
package main
import (
"os"
"strconv"
- "github.com/gogits/gogs/models"
-
"github.com/codegangsta/cli"
+
git "github.com/gogits/git"
+
+ "github.com/gogits/gogs/models"
+ "github.com/gogits/gogs/modules/log"
)
var CmdUpdate = cli.Command{
@@ -41,11 +47,18 @@ func runUpdate(*cli.Context) {
if err != nil {
return
}
- sUserId, _ := strconv.Atoi(userId)
- sRepoId, _ := strconv.Atoi(repoId)
- err = models.CommitRepoAction(int64(sUserId), userName,
- int64(sRepoId), repoName, lastCommit.Message())
+ sUserId, err := strconv.Atoi(userId)
if err != nil {
- //TODO: log
+ log.Error("runUpdate.Parse userId: %v", err)
+ return
+ }
+ sRepoId, err := strconv.Atoi(repoId)
+ if err != nil {
+ log.Error("runUpdate.Parse repoId: %v", err)
+ return
+ }
+ if err = models.CommitRepoAction(int64(sUserId), userName,
+ int64(sRepoId), repoName, lastCommit.Message()); err != nil {
+ log.Error("runUpdate.models.CommitRepoAction: %v", err)
}
}