Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/poetry/vcs/git/backend.py
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
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():
miles170 marked this conversation as resolved.
Show resolved Hide resolved
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