diff --git a/conf/locale/locale_en-US.ini b/conf/locale/locale_en-US.ini
index 30540d4791..23543a867a 100644
--- a/conf/locale/locale_en-US.ini
+++ b/conf/locale/locale_en-US.ini
@@ -966,7 +966,7 @@ notices.delete_success = System notice has been deleted successfully.
[action]
create_repo = created repository %s
rename_repo = renamed repository from %[1]s
to %[3]s
-commit_repo = pushed to %[2]s at %[3]s
+commit_repo = pushed to %[3]s at %[4]s
create_issue = `opened issue %s#%[2]s`
create_pull_request = `created pull request %s#%[2]s`
comment_issue = `commented on issue %s#%[2]s`
diff --git a/modules/git/utils.go b/modules/git/utils.go
index 78792aaf5e..d2d0c19ed9 100644
--- a/modules/git/utils.go
+++ b/modules/git/utils.go
@@ -35,6 +35,11 @@ func parsePrettyFormatLog(repo *Repository, logByts []byte) (*list.List, error)
}
func RefEndName(refStr string) string {
+ if strings.HasPrefix(refStr, "refs/heads/") {
+ // trim the "refs/heads/"
+ return refStr[len("refs/heads/"):]
+ }
+
index := strings.LastIndex(refStr, "/")
if index != -1 {
return refStr[index+1:]
diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl
index 70142f9a51..fff1e16f60 100644
--- a/templates/user/dashboard/feeds.tmpl
+++ b/templates/user/dashboard/feeds.tmpl
@@ -13,7 +13,8 @@
{{else if eq .GetOpType 2}}
{{$.i18n.Tr "action.rename_repo" .GetContent .GetRepoLink .GetRepoPath | Str2html}}
{{else if eq .GetOpType 5}}
- {{$.i18n.Tr "action.commit_repo" .GetRepoLink .GetBranch .GetRepoPath | Str2html}}
+ {{ $branchLink := .GetBranch | EscapePound}}
+ {{$.i18n.Tr "action.commit_repo" .GetRepoLink $branchLink .GetBranch .GetRepoPath | Str2html}}
{{else if eq .GetOpType 6}}
{{ $index := index .GetIssueInfos 0}}
{{$.i18n.Tr "action.create_issue" .GetRepoLink $index .GetRepoPath | Str2html}}