Skip to content

Commit 5174efc

Browse files
authored
Merge pull request #213 from python-poetry/fix/1.0/ensure-windows-git-executable-2
[1.0] Ensure the right executable is used when checking VCS
2 parents 3946ae0 + 8e7f2ef commit 5174efc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

poetry/core/vcs/__init__.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,17 @@ def get_vcs(directory): # type: (Path) -> Git
1212
os.chdir(str(directory.resolve()))
1313

1414
try:
15+
from .git import executable
16+
1517
git_dir = decode(
1618
subprocess.check_output(
17-
["git", "rev-parse", "--show-toplevel"], stderr=subprocess.STDOUT
19+
[executable(), "rev-parse", "--show-toplevel"], stderr=subprocess.STDOUT
1820
)
1921
).strip()
2022

2123
vcs = Git(Path(git_dir))
2224

23-
except (subprocess.CalledProcessError, OSError):
25+
except (subprocess.CalledProcessError, OSError, RuntimeError):
2426
vcs = None
2527
finally:
2628
os.chdir(str(working_dir))

0 commit comments

Comments
 (0)