aboutsummaryrefslogtreecommitdiff
path: root/modules/git/utils.go
diff options
context:
space:
mode:
authorEmrah URHAN <raxetul@gmail.com>2015-11-22 19:40:18 +0200
committerEmrah URHAN <raxetul@gmail.com>2015-11-22 19:40:18 +0200
commit737da1a3748d7c82af771d3ba4aa4c76ba219eee (patch)
treeb59104944ba28771752adcc1231a847b6704ac4d /modules/git/utils.go
parentf63a468dfce812423b78a47cfa2583c5ad2faa49 (diff)
parentefaf60ba5a4a7c0954dbaf57203859db3258281f (diff)
Latest develop updates is merged with my RaspberryPi Dockerfile version.
Merge branch 'develop' of https://github.com/gogits/gogs into develop
Diffstat (limited to 'modules/git/utils.go')
-rw-r--r--modules/git/utils.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/git/utils.go b/modules/git/utils.go
index 78792aaf..d2d0c19e 100644
--- a/modules/git/utils.go
+++ b/modules/git/utils.go
@@ -35,6 +35,11 @@ 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 refStr[len("refs/heads/"):]
+ }
+
index := strings.LastIndex(refStr, "/")
if index != -1 {
return refStr[index+1:]