summaryrefslogtreecommitdiffstats
path: root/modules/templates/helper.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/templates/helper.go')
-rw-r--r--modules/templates/helper.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/templates/helper.go b/modules/templates/helper.go
index 6517127ebf..00b07dcec9 100644
--- a/modules/templates/helper.go
+++ b/modules/templates/helper.go
@@ -819,6 +819,11 @@ func ActionContent2Commits(act Actioner) *repository.PushCommits {
if err := json.Unmarshal([]byte(act.GetContent()), push); err != nil {
log.Error("json.Unmarshal:\n%s\nERROR: %v", act.GetContent(), err)
}
+
+ if push.Len == 0 {
+ push.Len = len(push.Commits)
+ }
+
return push
}