aboutsummaryrefslogtreecommitdiff
path: root/pkg/template
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-07-27 16:53:02 -0400
committerUnknwon <u@gogs.io>2017-07-27 16:53:02 -0400
commit6bc11c44504135b232605c932c519901a680d4e1 (patch)
treee12a8d108ef2d00347a2d1789d50f61a1617cfaf /pkg/template
parent643c85e9c8fd237912652d14a0535dfddf614d2b (diff)
hook: fix email not sent after push (#4430)
Turns out mail service was not initialized at all, also mail must be sent in sync in hook mode before program exits.
Diffstat (limited to 'pkg/template')
-rw-r--r--pkg/template/template.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/pkg/template/template.go b/pkg/template/template.go
index 882be145..f93aca74 100644
--- a/pkg/template/template.go
+++ b/pkg/template/template.go
@@ -22,11 +22,12 @@ import (
"gopkg.in/editorconfig/editorconfig-core-go.v1"
"github.com/gogits/gogs/models"
- "github.com/gogits/gogs/pkg/tool"
"github.com/gogits/gogs/pkg/markup"
"github.com/gogits/gogs/pkg/setting"
+ "github.com/gogits/gogs/pkg/tool"
)
+// TODO: only initialize map once and save to a local variable to reduce copies.
func NewFuncMap() []template.FuncMap {
return []template.FuncMap{map[string]interface{}{
"GoVer": func() string {
@@ -91,13 +92,13 @@ func NewFuncMap() []template.FuncMap {
}
return str[start:end]
},
- "Join": strings.Join,
- "EllipsisString": tool.EllipsisString,
- "DiffTypeToStr": DiffTypeToStr,
- "DiffLineTypeToStr": DiffLineTypeToStr,
- "Sha1": Sha1,
- "ShortSHA1": tool.ShortSHA1,
- "MD5": tool.MD5,
+ "Join": strings.Join,
+ "EllipsisString": tool.EllipsisString,
+ "DiffTypeToStr": DiffTypeToStr,
+ "DiffLineTypeToStr": DiffLineTypeToStr,
+ "Sha1": Sha1,
+ "ShortSHA1": tool.ShortSHA1,
+ "MD5": tool.MD5,
"ActionContent2Commits": ActionContent2Commits,
"EscapePound": EscapePound,
"RenderCommitMessage": RenderCommitMessage,