return a.RepoName
}
+// CommitRepoAction records action for commit repository.
func CommitRepoAction(userId int64, userName string,
repoId int64, repoName string, msg string) error {
_, err := orm.InsertOne(&Action{
return err
}
-// NewRepoAction inserts action for create repository.
-
+// NewRepoAction records action for create repository.
func NewRepoAction(user *User, repo *Repository) error {
_, err := orm.InsertOne(&Action{
UserId: user.Id,
+// 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{
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)
}
}