File tree 2 files changed +14
-2
lines changed 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ func Parse(remote string) (*GitURL, error) {
61
61
lastIndex = i + 1
62
62
case ':' :
63
63
if ! squareBrackets {
64
- url .Host = remote [lastIndex :i ]
64
+ url .Host = strings . Replace ( remote [lastIndex :i ], "%25" , "%" , - 1 )
65
65
if len (remote ) <= i + 1 {
66
66
return nil , ErrWrongURLFormat {URL : remote }
67
67
}
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ func TestParseGitURLs(t *testing.T) {
34
34
URL : & url.URL {
35
35
Scheme : "ssh" ,
36
36
User : url .User ("git" ),
37
- Host : "[fe80:14fc:cec5:c174:d88%2510 ]" ,
37
+ Host : "[fe80:14fc:cec5:c174:d88%10 ]" ,
38
38
Path : "go-gitea/gitea.git" ,
39
39
},
40
40
extraMark : 1 ,
@@ -131,6 +131,18 @@ func TestParseGitURLs(t *testing.T) {
131
131
extraMark : 0 ,
132
132
},
133
133
},
134
+ {
135
+ kase : "https://[fe80:14fc:cec5:c174:d88%2510]:20/go-gitea/gitea.git" ,
136
+ expected : & GitURL {
137
+ URL : & url.URL {
138
+ Scheme : "https" ,
139
+ Host : "[fe80:14fc:cec5:c174:d88%10]:20" ,
140
+ Path : "/go-gitea/gitea.git" ,
141
+ },
142
+ extraMark : 0 ,
143
+ },
144
+ },
145
+
134
146
{
135
147
kase : "git://github.com/go-gitea/gitea.git" ,
136
148
expected : & GitURL {
You can’t perform that action at this time.
0 commit comments