summaryrefslogtreecommitdiffstats
path: root/modules/git/utils.go
diff options
context:
space:
mode:
authorArthur Ouyang <arthur.oy+github@gmail.com>2015-11-19 07:31:55 +0800
committerArthur Ouyang <arthur.oy+github@gmail.com>2015-11-19 07:31:55 +0800
commite04c97b9fa3a9955e967a918aada9b21a78a0ec6 (patch)
tree6f19ecb388c3e8ce998d4cd58b573af9d7198e8b /modules/git/utils.go
parentf04d773f4f72f8f167b7ceed4d4e9a6fd4e6ad16 (diff)
downloadgitea-e04c97b9fa3a9955e967a918aada9b21a78a0ec6.tar.gz
gitea-e04c97b9fa3a9955e967a918aada9b21a78a0ec6.zip
Fix #1965 - the hyperlink and the display name of the branch
The hyperlink and the display name of the branch if the branch is in a folder or the branch name has '#'
Diffstat (limited to 'modules/git/utils.go')
-rw-r--r--modules/git/utils.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/git/utils.go b/modules/git/utils.go
index 78792aaf5e..43a4da3d10 100644
--- a/modules/git/utils.go
+++ b/modules/git/utils.go
@@ -35,6 +35,10 @@ func parsePrettyFormatLog(repo *Repository, logByts []byte) (*list.List, error)
}
func RefEndName(refStr string) string {
+ if strings.HasPrefix(refStr, "refs/heads/") {
+ return strings.TrimPrefix(refStr, "refs/heads/")
+ }
+
index := strings.LastIndex(refStr, "/")
if index != -1 {
return refStr[index+1:]