summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorArthur Ouyang <arthur.oy+github@gmail.com>2015-11-19 08:05:27 +0800
committerArthur Ouyang <arthur.oy+github@gmail.com>2015-11-19 08:05:27 +0800
commit0bd4d15e4722e77a858a2683c0583ac2f53c633b (patch)
treeb722d7a0e737b2fffe72c1bb9f61dd648c651c2f /modules
parente04c97b9fa3a9955e967a918aada9b21a78a0ec6 (diff)
downloadgitea-0bd4d15e4722e77a858a2683c0583ac2f53c633b.tar.gz
gitea-0bd4d15e4722e77a858a2683c0583ac2f53c633b.zip
Use refStr[11:] instead of TrimPrefix
Fix #1965
Diffstat (limited to 'modules')
-rw-r--r--modules/git/utils.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/git/utils.go b/modules/git/utils.go
index 43a4da3d10..73d32d3541 100644
--- a/modules/git/utils.go
+++ b/modules/git/utils.go
@@ -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, "/")