فهرست منبع

pass key_filename and ssh_command to SSHGitClient (#1981)

The `key_filename` and `ssh_command` were not being used or passed to
any clients.


https://github.com/jelmer/dulwich/blob/5ec1f042f400bdc216aac0d482408832a8c25be3/dulwich/client.py#L4218-L4231


We were relying on the former (`key_filename`) within the tests in
scmrepo.

This also regressed with
https://github.com/jelmer/dulwich/commit/0b0fed6ee6e75797fd50e8d5db7183b182784059.
Jelmer Vernooij 2 ماه پیش
والد
کامیت
33044621ce
1فایلهای تغییر یافته به همراه8 افزوده شده و 0 حذف شده
  1. 8 0
      dulwich/client.py

+ 8 - 0
dulwich/client.py

@@ -3063,6 +3063,8 @@ class SSHGitClient(TraditionalGitClient):
         config: Config | None = None,
         config: Config | None = None,
         path_encoding: str = TraditionalGitClient.DEFAULT_ENCODING,
         path_encoding: str = TraditionalGitClient.DEFAULT_ENCODING,
         vendor: SSHVendor | None = None,
         vendor: SSHVendor | None = None,
+        key_filename: str | None = None,
+        ssh_command: str | None = None,
     ) -> "SSHGitClient":
     ) -> "SSHGitClient":
         """Create an SSHGitClient from a parsed URL.
         """Create an SSHGitClient from a parsed URL.
 
 
@@ -3078,6 +3080,8 @@ class SSHGitClient(TraditionalGitClient):
           config: Configuration object
           config: Configuration object
           path_encoding: Encoding for paths
           path_encoding: Encoding for paths
           vendor: SSH implementation to use
           vendor: SSH implementation to use
+          key_filename: Optional SSH key file
+          ssh_command: Optional custom SSH command
 
 
         Returns:
         Returns:
           An SSHGitClient instance
           An SSHGitClient instance
@@ -3096,6 +3100,8 @@ class SSHGitClient(TraditionalGitClient):
             vendor=vendor,
             vendor=vendor,
             config=config,
             config=config,
             password=password,
             password=password,
+            key_filename=key_filename,
+            ssh_command=ssh_command,
         )
         )
 
 
     def _get_cmd_path(self, cmd: bytes) -> bytes:
     def _get_cmd_path(self, cmd: bytes) -> bytes:
@@ -4300,6 +4306,8 @@ def _get_transport_and_path_from_url(
             report_activity=report_activity,
             report_activity=report_activity,
             quiet=quiet,
             quiet=quiet,
             include_tags=include_tags,
             include_tags=include_tags,
+            key_filename=key_filename,
+            ssh_command=ssh_command,
         ), parsed.path
         ), parsed.path
     elif parsed.scheme in ("http", "https"):
     elif parsed.scheme in ("http", "https"):
         return (
         return (