From 8e7f2ef5663fe2bd233ea323f469a9ddd6838677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Eustace?= Date: Sat, 2 Oct 2021 15:47:51 +0200 Subject: [PATCH] Ensure the right executable is used when checking VCS # Conflicts: # poetry/core/vcs/__init__.py --- poetry/core/vcs/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/poetry/core/vcs/__init__.py b/poetry/core/vcs/__init__.py index d831b2a28..a97f1a7f6 100644 --- a/poetry/core/vcs/__init__.py +++ b/poetry/core/vcs/__init__.py @@ -12,15 +12,17 @@ def get_vcs(directory): # type: (Path) -> Git os.chdir(str(directory.resolve())) try: + from .git import executable + git_dir = decode( subprocess.check_output( - ["git", "rev-parse", "--show-toplevel"], stderr=subprocess.STDOUT + [executable(), "rev-parse", "--show-toplevel"], stderr=subprocess.STDOUT ) ).strip() vcs = Git(Path(git_dir)) - except (subprocess.CalledProcessError, OSError): + except (subprocess.CalledProcessError, OSError, RuntimeError): vcs = None finally: os.chdir(str(working_dir))