0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-19 08:22:44 +01:00

Use refStr[11:] instead of TrimPrefix

Fix #1965
This commit is contained in:
Arthur Ouyang 2015-11-19 08:05:27 +08:00
parent e04c97b9fa
commit 0bd4d15e47

View file

@ -36,7 +36,8 @@ 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/")
// trim the "refs/heads/"
return return refStr[11:]
}
index := strings.LastIndex(refStr, "/")