aboutsummaryrefslogtreecommitdiffstats
path: root/services/webhook/slack.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/webhook/slack.go')
-rw-r--r--services/webhook/slack.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/webhook/slack.go b/services/webhook/slack.go
index c2d4a7731e..0cb27bb3dd 100644
--- a/services/webhook/slack.go
+++ b/services/webhook/slack.go
@@ -93,7 +93,7 @@ func SlackLinkFormatter(url, text string) string {
// SlackLinkToRef slack-formatter link to a repo ref
func SlackLinkToRef(repoURL, ref string) string {
url := git.RefURL(repoURL, ref)
- refName := git.RefEndName(ref)
+ refName := git.RefName(ref).ShortName()
return SlackLinkFormatter(url, refName)
}
@@ -110,7 +110,7 @@ func (s *SlackPayload) Create(p *api.CreatePayload) (api.Payloader, error) {
// Delete composes Slack payload for delete a branch or tag.
func (s *SlackPayload) Delete(p *api.DeletePayload) (api.Payloader, error) {
- refName := git.RefEndName(p.Ref)
+ refName := git.RefName(p.Ref).ShortName()
repoLink := SlackLinkFormatter(p.Repo.HTMLURL, p.Repo.FullName)
text := fmt.Sprintf("[%s:%s] %s deleted by %s", repoLink, refName, p.RefType, p.Sender.UserName)