From 0bd4d15e4722e77a858a2683c0583ac2f53c633b Mon Sep 17 00:00:00 2001 From: Arthur Ouyang Date: Thu, 19 Nov 2015 08:05:27 +0800 Subject: Use refStr[11:] instead of TrimPrefix Fix #1965 --- modules/git/utils.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules/git') 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, "/") -- cgit v1.2.3