File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -327,12 +327,18 @@ def fetch_refspecs(
327327 progress : Optional [Callable [["GitProgressEvent" ], None ]] = None ,
328328 ** kwargs ,
329329 ) -> typing .Mapping [str , SyncStatus ]:
330+ from urllib .parse import urlparse
331+
330332 from .credentials import get_matching_helper_commands
331333
332- if "dulwich" in kwargs .get ("backends" , self .backends .backends ) and any (
333- get_matching_helper_commands (url , self .dulwich .repo .get_config_stack ())
334- ):
335- kwargs ["backends" ] = ["dulwich" ]
334+ if "dulwich" in kwargs .get ("backends" , self .backends .backends ):
335+ credentials_helper = any (
336+ get_matching_helper_commands (url , self .dulwich .repo .get_config_stack ())
337+ )
338+ parsed = urlparse (url )
339+ ssh = parsed .scheme in ("git" , "git+ssh" , "ssh" ) or url .startswith ("git@" )
340+ if credentials_helper or ssh :
341+ kwargs ["backends" ] = ["dulwich" ]
336342
337343 return self ._fetch_refspecs (
338344 url ,
You can’t perform that action at this time.
0 commit comments