Skip to content

Commit a1c5096

Browse files
committed
gogs/gogs#2677 check order of detected chars for submodule
1 parent 1908316 commit a1c5096

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

git.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"time"
1111
)
1212

13-
const _VERSION = "0.2.6"
13+
const _VERSION = "0.2.7"
1414

1515
func Version() string {
1616
return _VERSION

submodule.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ func (sf *SubModuleFile) RefUrl(urlPrefix string) string {
4949
// sysuser@xxx:user/repo
5050
i := strings.Index(url, "@")
5151
j := strings.LastIndex(url, ":")
52-
if i > -1 && j > -1 {
52+
53+
// Only process when i < j because git+ssh://[email protected]/npploader.git
54+
if i > -1 && j > -1 && i < j {
5355
// fix problem with reverse proxy works only with local server
5456
if strings.Contains(urlPrefix, url[i+1:j]) {
5557
return urlPrefix + url[j+1:]

0 commit comments

Comments
 (0)