diff --git a/routers/private/hook.go b/routers/private/hook.go index 79c8ecfc5..38abd4953 100755 --- a/routers/private/hook.go +++ b/routers/private/hook.go @@ -416,6 +416,10 @@ func HookPostReceive(ctx *macaron.Context, opts private.HookOptions) { copy(updates[1:], updates) updates[0] = &option } + + if err := updateRepoCommitCnt(ctx, repo); err != nil { + log.Error("updateRepoCommitCnt failed:%v", err.Error(), ctx.Data["MsgID"]) + } } } @@ -521,10 +525,6 @@ func HookPostReceive(ctx *macaron.Context, opts private.HookOptions) { } } - if err := updateRepoCommitCnt(ctx, repo); err != nil { - log.Error("updateRepoCommitCnt failed:%v", err.Error(), ctx.Data["MsgID"]) - } - ctx.JSON(http.StatusOK, private.HookPostReceiveResult{ Results: results, RepoWasEmpty: wasEmpty,