index
:
gogs.git
Gogs is a painless self-hosted Git service
log msg
author
committer
range
buildscript
main
mygogs
about
summary
refs
log
tree
commit
diff
path:
root
/
modules
/
git
/
utils.go
diff options
context:
1
2
3
4
5
6
7
8
9
10
15
20
25
30
35
40
space:
include
ignore
mode:
unified
ssdiff
stat only
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
)
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 73d32d35..d2d0c19e 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, "/")