summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-11-18 23:01:06 -0500
committerUnknwon <u@gogs.io>2015-11-18 23:01:06 -0500
commit915bf1d2e329ff5d66eac2d475cd00f52f48c896 (patch)
tree6b7ef462e8155ea1e33821704b0082db10519894 /modules
parentf455125d4de8c788143a24edefb8c6b2cef0f524 (diff)
parentfc56f42dc35a60395ca8def114a23a6c7655c410 (diff)
downloadgitea-915bf1d2e329ff5d66eac2d475cd00f52f48c896.tar.gz
gitea-915bf1d2e329ff5d66eac2d475cd00f52f48c896.zip
Merge pull request #1994 from arthuroy/develop
Fix #1965 - the hyperlink and the display name of the branch
Diffstat (limited to 'modules')
-rw-r--r--modules/git/utils.go5
1 files changed, 5 insertions, 0 deletions
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:]