Skip to content

Commit

Permalink
Fix issue with creating new projects Windows
Browse files Browse the repository at this point in the history
The previous code contained a bug where git couldn't reside
in relative subdirectory.

It appears to have done this in attempt to get the absolute
path of the git executable. Instead, I just use resolve
to resolve potential symlinks, etc.
  • Loading branch information
brycepg committed Dec 12, 2023
1 parent 56c0376 commit c6fc8c1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/poetry/core/vcs/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,10 @@ def executable() -> str:
if not path:
continue

_path = Path(path.strip())
try:
_path.relative_to(Path.cwd())
except ValueError:
_path = Path(path.strip()).resolve()
# Skip git in the current directory
if _path != Path.cwd().resolve() / "git.exe"
_executable = str(_path)

break
else:
_executable = "git"
Expand Down

0 comments on commit c6fc8c1

Please sign in to comment.