commit 155d507dbcbcad9a55fb934225aa86e9c21a12d1 from: Jelmer Vernooij via: GitHub date: Sat Sep 03 22:57:38 2022 UTC Merge pull request #1027 from jelmer/clone-load-config Ensure the configuration is loaded in dulwich.porcelain.clone commit - c5b61f2afaf80bdbc222fd88d67189cf13c668d7 commit + 155d507dbcbcad9a55fb934225aa86e9c21a12d1 blob - 5149ed819f8e378d39f971153315b0d5f50f381d blob + 5bf2112bfdfb23fb71b880f3a18c79f389ebe232 --- dulwich/porcelain.py +++ dulwich/porcelain.py @@ -407,6 +407,7 @@ def clone( origin="origin", depth=None, branch=None, + config=None, **kwargs ): """Clone a local or remote git repository. @@ -422,6 +423,7 @@ def clone( depth: Depth to fetch at branch: Optional branch or tag to be used as HEAD in the new repository instead of the cloned repository's HEAD. + config: Configuration to use Returns: The new repository """ if outstream is not None: @@ -433,6 +435,9 @@ def clone( stacklevel=3, ) # TODO(jelmer): Capture logging output and stream to errstream + + if config is None: + config = StackedConfig.default() if checkout is None: checkout = not bare @@ -444,7 +449,8 @@ def clone( mkdir = not os.path.exists(target) - (client, path) = get_transport_and_path(source, **kwargs) + (client, path) = get_transport_and_path( + source, config=config, **kwargs) return client.clone( path,