]> source.dussan.org Git - gitea.git/commitdiff
Use refStr[len("refs/heads/"):] instead of refStr[11:] and fix error
authorArthur Ouyang <arthur.oy+github@gmail.com>
Thu, 19 Nov 2015 00:10:44 +0000 (08:10 +0800)
committerArthur Ouyang <arthur.oy+github@gmail.com>
Thu, 19 Nov 2015 00:10:44 +0000 (08:10 +0800)
Fix #1965

modules/git/utils.go

index 73d32d3541ba66f84c4fdc6cb04d50e88b03842b..d2d0c19ed932ef7e0d31732961f4c91ceebb6d80 100644 (file)
@@ -37,7 +37,7 @@ 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 return refStr[11:]
+               return refStr[len("refs/heads/"):]
        }
 
        index := strings.LastIndex(refStr, "/")