@@ -126,8 +126,8 @@ def convert_pip_url(pip_url: str) -> VCSLocation:
126
126
127
127
128
128
class RemoteDict (TypedDict ):
129
- fetch : str
130
- push : str
129
+ fetch_url : str
130
+ push_url : str
131
131
132
132
133
133
FullRemoteDict = Dict [str , RemoteDict ]
@@ -195,21 +195,23 @@ def __init__(
195
195
self ._remotes : Union [FullRemoteDict , None ]
196
196
197
197
if remotes is None :
198
- self ._remotes : FullRemoteDict = {"origin" : {"fetch" : url , "push" : url }}
198
+ self ._remotes : FullRemoteDict = {
199
+ "origin" : {"fetch_url" : url , "push_url" : url }
200
+ }
199
201
elif isinstance (remotes , dict ):
200
202
self ._remotes : FullRemoteDict = remotes
201
203
for remote_name , url in remotes .items ():
202
204
if isinstance (url , str ):
203
205
remotes [remote_name ] = {
204
- "fetch " : url ,
205
- "push " : url ,
206
+ "fetch_url " : url ,
207
+ "push_url " : url ,
206
208
}
207
209
208
210
BaseRepo .__init__ (self , url , repo_dir , * args , ** kwargs )
209
211
self .url = (
210
- self ._remotes .get ("origin" )["fetch " ]
212
+ self ._remotes .get ("origin" )["fetch_url " ]
211
213
if self ._remotes .get ("origin" )
212
- else next (iter (self ._remotes .items ()))[1 ]["fetch " ]
214
+ else next (iter (self ._remotes .items ()))[1 ]["fetch_url " ]
213
215
)
214
216
215
217
@classmethod
@@ -231,21 +233,24 @@ def set_remotes(self, overwrite: bool = False):
231
233
if isinstance (remotes , dict ):
232
234
for remote_name , url in remotes .items ():
233
235
existing_remote = self .remote (remote_name )
234
- if isinstance (url , dict ) and "fetch" in url :
235
- if not existing_remote or existing_remote .fetch_url != url ["fetch" ]:
236
+ if isinstance (url , dict ) and "fetch_url" in url :
237
+ if (
238
+ not existing_remote
239
+ or existing_remote .fetch_url != url ["fetch_url" ]
240
+ ):
236
241
self .set_remote (
237
- name = remote_name , url = url ["fetch " ], overwrite = overwrite
242
+ name = remote_name , url = url ["fetch_url " ], overwrite = overwrite
238
243
)
239
244
# refresh if we're setting it, so push can be checked
240
245
existing_remote = self .remote (remote_name )
241
- if "push " in url :
246
+ if "push_url " in url :
242
247
if (
243
248
not existing_remote
244
- or existing_remote .push_url != url ["push " ]
249
+ or existing_remote .push_url != url ["push_url " ]
245
250
):
246
251
self .set_remote (
247
252
name = remote_name ,
248
- url = url ["push " ],
253
+ url = url ["push_url " ],
249
254
push = True ,
250
255
overwrite = overwrite ,
251
256
)
@@ -357,7 +362,7 @@ def update_repo(self, set_remotes: bool = False, *args, **kwargs):
357
362
return
358
363
359
364
try :
360
- process = self .run (["fetch " ], log_in_real_time = True )
365
+ process = self .run (["fetch_url " ], log_in_real_time = True )
361
366
except exc .CommandError :
362
367
self .error ("Failed to fetch repository '%s'" % url )
363
368
return
0 commit comments