commit - e3a58bcee71e645118a7597a1b943b33c9024613
commit + 3d4322c06fa79ddfff95e09dbc365b83d9b3f15b
blob - 191aa74318864fdf1ccf8477f833335955a324e0
blob + cf2e2c516350dafdb60847ebb3adcb2c7614f22c
--- dulwich/client.py
+++ dulwich/client.py
"""
if config is not None:
url = apply_instead_of(config, url, push=(operation == "push"))
+
+ return _get_transport_and_path_from_url(
+ url, config=config, operation=operation, **kwargs)
+
+
+def _get_transport_and_path_from_url(url, config, operation, **kwargs):
parsed = urlparse(url)
if parsed.scheme == "git":
return (TCPGitClient.from_parsedurl(parsed, **kwargs), parsed.path)
def get_transport_and_path(
location: str,
+ config: Optional[Config] = None,
operation: Optional[str] = None,
**kwargs: Any
) -> Tuple[GitClient, str]:
Tuple with client instance and relative path.
"""
+ if config is not None:
+ location = apply_instead_of(config, location, push=(operation == "push"))
+
# First, try to parse it as a URL
try:
- return get_transport_and_path_from_url(location, operation=operation, **kwargs)
+ return _get_transport_and_path_from_url(
+ location, config=config, operation=operation, **kwargs)
except ValueError:
pass