Skip to content

Commit

Permalink
fix(git): experimental.system-git-client can't be set using environ…
Browse files Browse the repository at this point in the history
…ment variable

Resolves: #6722
  • Loading branch information
miles170 authored Oct 12, 2022
1 parent 0ffe91c commit 0b71e43
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/poetry/vcs/git/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,8 @@ def _clone_submodules(cls, repo: Repo) -> None:
def is_using_legacy_client() -> bool:
from poetry.config.config import Config

legacy_client: bool = (
Config.create().get("experimental", {}).get("system-git-client", False)
legacy_client: bool = Config.create().get(
"experimental.system-git-client", False
)
return legacy_client

Expand Down
7 changes: 7 additions & 0 deletions tests/integration/test_utils_vcs_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ def remote_default_branch(remote_default_ref: bytes) -> str:
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(
source_url: str, remote_refs: FetchPackResult, remote_default_ref: bytes
) -> None:
Expand Down

0 comments on commit 0b71e43

Please sign in to comment.