diff options
author | Unknwon <u@gogs.io> | 2015-11-18 23:01:06 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-11-18 23:01:06 -0500 |
commit | 915bf1d2e329ff5d66eac2d475cd00f52f48c896 (patch) | |
tree | 6b7ef462e8155ea1e33821704b0082db10519894 /modules | |
parent | f455125d4de8c788143a24edefb8c6b2cef0f524 (diff) | |
parent | fc56f42dc35a60395ca8def114a23a6c7655c410 (diff) | |
download | gitea-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.go | 5 |
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:] |