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

[1.0] Ensure the right executable is used when checking VCS #213

Merged
merged 1 commit into from
Oct 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Ensure the right executable is used when checking VCS
# Conflicts:
#	poetry/core/vcs/__init__.py
  • Loading branch information
sdispater committed Oct 2, 2021
commit 8e7f2ef5663fe2bd233ea323f469a9ddd6838677
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