mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-08-06 18:24:39 +08:00
Trigger sync webhooks on UI commit (#2302)
* Trigger sync webhooks on UI commit * Also fix UI upload/delete
This commit is contained in:
@ -32,15 +32,7 @@ func PushUpdate(ctx *macaron.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
repo, err := models.PushUpdate(opt)
|
||||
if err != nil {
|
||||
ctx.JSON(500, map[string]interface{}{
|
||||
"err": err.Error(),
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
pusher, err := models.GetUserByID(opt.PusherID)
|
||||
err := models.PushUpdate(branch, opt)
|
||||
if err != nil {
|
||||
if models.IsErrUserNotExist(err) {
|
||||
ctx.Error(404)
|
||||
@ -51,10 +43,5 @@ func PushUpdate(ctx *macaron.Context) {
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
log.Trace("TriggerTask '%s/%s' by %s", repo.Name, branch, pusher.Name)
|
||||
|
||||
go models.HookQueue.Add(repo.ID)
|
||||
go models.AddTestPullRequestTask(pusher, repo.ID, branch, true)
|
||||
ctx.Status(202)
|
||||
}
|
||||
|
Reference in New Issue
Block a user