summaryrefslogtreecommitdiffstats
path: root/modules/git/utils.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/git/utils.go')
-rw-r--r--modules/git/utils.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/git/utils.go b/modules/git/utils.go
index 13926fba72..6988f31a36 100644
--- a/modules/git/utils.go
+++ b/modules/git/utils.go
@@ -11,6 +11,8 @@ import (
"strconv"
"strings"
"sync"
+
+ "code.gitea.io/gitea/modules/util"
)
// ObjectCache provides thread-safe cache operations.
@@ -92,7 +94,7 @@ func RefEndName(refStr string) string {
// RefURL returns the absolute URL for a ref in a repository
func RefURL(repoURL, ref string) string {
- refName := RefEndName(ref)
+ refName := util.PathEscapeSegments(RefEndName(ref))
switch {
case strings.HasPrefix(ref, BranchPrefix):
return repoURL + "/src/branch/" + refName