From f2650f13a5b772266735ba077d551d426efd9bfc Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Wed, 9 Mar 2022 14:38:43 +0800 Subject: [PATCH] fix 1608 --- routers/private/hook.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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,