Skip to content

Commit 3db2ea8

Browse files
committed
Fix issue with creating new projects Windows
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.
1 parent 56c0376 commit 3db2ea8

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/poetry/core/vcs/git.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,9 @@ def executable() -> str:
168168
if not path:
169169
continue
170170

171-
_path = Path(path.strip())
172-
try:
173-
_path.relative_to(Path.cwd())
174-
except ValueError:
171+
_path = Path(path.strip()).resolve()
172+
if _path.drive == Path.cwd().drive:
175173
_executable = str(_path)
176-
177174
break
178175
else:
179176
_executable = "git"

0 commit comments

Comments
 (0)