Skip to content

Commit

Permalink
Merge pull request #213 from python-poetry/fix/1.0/ensure-windows-git…
Browse files Browse the repository at this point in the history
…-executable-2

[1.0] Ensure the right executable is used when checking VCS
  • Loading branch information
sdispater committed Oct 4, 2021
2 parents 3946ae0 + 8e7f2ef commit 5174efc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions poetry/core/vcs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 5174efc

Please sign in to comment.