Commit 0b71e438 by miles Committed by GitHub

fix(git): `experimental.system-git-client` can't be set using environment variable

Resolves: #6722
parent 0ffe91c0
...@@ -366,8 +366,8 @@ class Git: ...@@ -366,8 +366,8 @@ class Git:
def is_using_legacy_client() -> bool: def is_using_legacy_client() -> bool:
from poetry.config.config import Config from poetry.config.config import Config
legacy_client: bool = ( legacy_client: bool = Config.create().get(
Config.create().get("experimental", {}).get("system-git-client", False) "experimental.system-git-client", False
) )
return legacy_client return legacy_client
......
...@@ -111,6 +111,13 @@ def remote_default_branch(remote_default_ref: bytes) -> str: ...@@ -111,6 +111,13 @@ def remote_default_branch(remote_default_ref: bytes) -> str:
return remote_default_ref.decode("utf-8").replace("refs/heads/", "") return remote_default_ref.decode("utf-8").replace("refs/heads/", "")
# Regression test for https://github.com/python-poetry/poetry/issues/6722
def test_use_system_git_client_from_environment_variables():
os.environ["POETRY_EXPERIMENTAL_SYSTEM_GIT_CLIENT"] = "true"
assert Git.is_using_legacy_client()
def test_git_local_info( def test_git_local_info(
source_url: str, remote_refs: FetchPackResult, remote_default_ref: bytes source_url: str, remote_refs: FetchPackResult, remote_default_ref: bytes
) -> None: ) -> None:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment