aboutsummaryrefslogtreecommitdiff
path: root/routers/repo/http.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo/http.go')
-rw-r--r--routers/repo/http.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/routers/repo/http.go b/routers/repo/http.go
index 52c9fbd3..214cc9ba 100644
--- a/routers/repo/http.go
+++ b/routers/repo/http.go
@@ -34,7 +34,7 @@ func authRequired(ctx *middleware.Context) {
ctx.HTML(401, base.TplName("status/401"))
}
-func Http(ctx *middleware.Context) {
+func HTTP(ctx *middleware.Context) {
username := ctx.Params(":username")
reponame := ctx.Params(":reponame")
if strings.HasSuffix(reponame, ".git") {
@@ -158,7 +158,7 @@ func Http(ctx *middleware.Context) {
}
if !isPull && repo.IsMirror {
- ctx.HandleText(401, "can't push to mirror")
+ ctx.HandleText(401, "mirror repository is read-only")
return
}
}
@@ -195,7 +195,8 @@ func Http(ctx *middleware.Context) {
// FIXME: handle error.
if err = models.Update(refName, oldCommitId, newCommitId, authUsername, username, reponame, authUser.Id); err == nil {
- models.HookQueue.AddRepoID(repo.ID)
+ go models.HookQueue.Add(repo.ID)
+ go models.AddTestPullRequestTask(repo.ID, strings.TrimPrefix(refName, "refs/heads/"))
}
}