@@ -46,6 +46,12 @@ func (s *RemoteSuite) TestFetchInvalidSchemaEndpoint(c *C) {
46
46
c .Assert (err , ErrorMatches , ".*unsupported scheme.*" )
47
47
}
48
48
49
+ func (s * RemoteSuite ) TestFetchOverriddenEndpoint (c * C ) {
50
+ r := NewRemote (nil , & config.RemoteConfig {Name : "foo" , URLs : []string {"http://perfectly-valid-url.example.com" }})
51
+ err := r .Fetch (& FetchOptions {RemoteURL : "http://\\ " })
52
+ c .Assert (err , ErrorMatches , ".*invalid character.*" )
53
+ }
54
+
49
55
func (s * RemoteSuite ) TestFetchInvalidFetchOptions (c * C ) {
50
56
r := NewRemote (nil , & config.RemoteConfig {Name : "foo" , URLs : []string {"qux://foo" }})
51
57
invalid := config .RefSpec ("^*$ñ" )
@@ -903,6 +909,12 @@ func (s *RemoteSuite) TestPushNonExistentEndpoint(c *C) {
903
909
c .Assert (err , NotNil )
904
910
}
905
911
912
+ func (s * RemoteSuite ) TestPushOverriddenEndpoint (c * C ) {
913
+ r := NewRemote (nil , & config.RemoteConfig {Name : "origin" , URLs : []string {"http://perfectly-valid-url.example.com" }})
914
+ err := r .Push (& PushOptions {RemoteURL : "http://\\ " })
915
+ c .Assert (err , ErrorMatches , ".*invalid character.*" )
916
+ }
917
+
906
918
func (s * RemoteSuite ) TestPushInvalidSchemaEndpoint (c * C ) {
907
919
r := NewRemote (nil , & config.RemoteConfig {Name : "origin" , URLs : []string {"qux://foo" }})
908
920
err := r .Push (& PushOptions {})
0 commit comments