diff options
author | skyblue <ssx205@gmail.com> | 2014-03-24 23:09:18 +0800 |
---|---|---|
committer | skyblue <ssx205@gmail.com> | 2014-03-24 23:09:18 +0800 |
commit | e75ab8cdbd62426157c23e86259a9167748d1dca (patch) | |
tree | 1fc190552549e8f36169c24c991e4ca2c350f468 /models/action.go | |
parent | 6e972afb1563d1eb585c9900e3c85330726d5b50 (diff) | |
parent | 0e28dcdac402b3bfc8336fe250e3418939467208 (diff) |
Merge branch 'master' of github.com:gogits/gogs
Diffstat (limited to 'models/action.go')
-rw-r--r-- | models/action.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/models/action.go b/models/action.go index 11749293..44d7aea8 100644 --- a/models/action.go +++ b/models/action.go @@ -59,14 +59,18 @@ func (a Action) GetContent() string { // CommitRepoAction records action for commit repository. func CommitRepoAction(userId int64, userName string, repoId int64, repoName string, refName string, commits *base.PushCommits) error { + log.Trace("action.CommitRepoAction: %d/%s", userId, repoName) + bs, err := json.Marshal(commits) if err != nil { + log.Error("action.CommitRepoAction(json): %d/%s", userId, repoName) return err } // Add feeds for user self and all watchers. watches, err := GetWatches(repoId) if err != nil { + log.Error("action.CommitRepoAction(get watches): %d/%s", userId, repoName) return err } watches = append(watches, Watch{UserId: userId}) @@ -86,20 +90,23 @@ func CommitRepoAction(userId int64, userName string, RepoName: repoName, RefName: refName, }) + if err != nil { + log.Error("action.CommitRepoAction(notify watches): %d/%s", userId, repoName) + } return err } // Update repository last update time. repo, err := GetRepositoryByName(userId, repoName) if err != nil { + log.Error("action.CommitRepoAction(GetRepositoryByName): %d/%s", userId, repoName) return err } repo.IsBare = false if err = UpdateRepository(repo); err != nil { + log.Error("action.CommitRepoAction(UpdateRepository): %d/%s", userId, repoName) return err } - - log.Trace("action.CommitRepoAction: %d/%s", userId, repo.LowerName) return nil } |