fixed compile error caused by laziness

This commit is contained in:
Brad Rydzewski 2014-08-14 12:49:45 -07:00
parent 52422a3116
commit 6af9d40c4b
2 changed files with 6 additions and 5 deletions

View file

@ -12,6 +12,7 @@ import (
) )
type CommitHandler struct { type CommitHandler struct {
users database.UserManager
perms database.PermManager perms database.PermManager
repos database.RepoManager repos database.RepoManager
commits database.CommitManager commits database.CommitManager
@ -19,8 +20,8 @@ type CommitHandler struct {
queue chan *model.Request queue chan *model.Request
} }
func NewCommitHandler(repos database.RepoManager, commits database.CommitManager, perms database.PermManager, sess session.Session, queue chan *model.Request) *CommitHandler { func NewCommitHandler(users database.UserManager, repos database.RepoManager, commits database.CommitManager, perms database.PermManager, sess session.Session, queue chan *model.Request) *CommitHandler {
return &CommitHandler{perms, repos, commits, sess, queue} return &CommitHandler{users, perms, repos, commits, sess, queue}
} }
// GetFeed gets recent commits for the repository and branch // GetFeed gets recent commits for the repository and branch
@ -157,7 +158,7 @@ func (h *CommitHandler) PostCommit(w http.ResponseWriter, r *http.Request) error
return internalServerError{err} return internalServerError{err}
} }
owner, err := h.users.Find(repo.UserID) repoOwner, err := h.users.Find(repo.UserID)
if err != nil { if err != nil {
return badRequest{err} return badRequest{err}
} }
@ -166,7 +167,7 @@ func (h *CommitHandler) PostCommit(w http.ResponseWriter, r *http.Request) error
// drop the items on the queue // drop the items on the queue
go func() { go func() {
h.queue <- &model.Request{ h.queue <- &model.Request{
User: owner, User: repoOwner,
Host: httputil.GetURL(r), Host: httputil.GetURL(r),
Repo: repo, Repo: repo,
Commit: c, Commit: c,

View file

@ -106,7 +106,7 @@ func main() {
handler.NewUserHandler(users, repos, commits, sess).Register(router) handler.NewUserHandler(users, repos, commits, sess).Register(router)
handler.NewHookHandler(users, repos, commits, remotes, queue).Register(router) handler.NewHookHandler(users, repos, commits, remotes, queue).Register(router)
handler.NewLoginHandler(users, repos, perms, sess, remotes).Register(router) handler.NewLoginHandler(users, repos, perms, sess, remotes).Register(router)
handler.NewCommitHandler(repos, commits, perms, sess, queue).Register(router) handler.NewCommitHandler(users, repos, commits, perms, sess, queue).Register(router)
handler.NewRepoHandler(repos, commits, perms, sess, remotes).Register(router) handler.NewRepoHandler(repos, commits, perms, sess, remotes).Register(router)
handler.NewBadgeHandler(repos, commits).Register(router) handler.NewBadgeHandler(repos, commits).Register(router)
handler.NewServerHandler(servers, sess).Register(router) handler.NewServerHandler(servers, sess).Register(router)