diff options
author | Arthur Ouyang <arthur.oy+github@gmail.com> | 2015-11-19 08:10:44 +0800 |
---|---|---|
committer | Arthur Ouyang <arthur.oy+github@gmail.com> | 2015-11-19 08:10:44 +0800 |
commit | fc56f42dc35a60395ca8def114a23a6c7655c410 (patch) | |
tree | 68966720c15068a56a0a96ef348fb3c44fb216f7 /modules/git/utils.go | |
parent | 0bd4d15e4722e77a858a2683c0583ac2f53c633b (diff) | |
download | gitea-fc56f42dc35a60395ca8def114a23a6c7655c410.tar.gz gitea-fc56f42dc35a60395ca8def114a23a6c7655c410.zip |
Use refStr[len("refs/heads/"):] instead of refStr[11:] and fix error
Fix #1965
Diffstat (limited to 'modules/git/utils.go')
-rw-r--r-- | modules/git/utils.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/git/utils.go b/modules/git/utils.go index 73d32d3541..d2d0c19ed9 100644 --- a/modules/git/utils.go +++ b/modules/git/utils.go @@ -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, "/") |