Skip to content

Conversation

@brycepg
Copy link

@brycepg brycepg commented Dec 12, 2023

The previous code contained a bug where git couldn't reside in a relative subdirectory.

This change allows git to be installed in the user directory while avoiding git.exe from being injected via the current directory

For example the package manager scoop installes git.exe at %userprofile%/scoop/shims/git.exe which would previously cause poetry to fail.

I'd be also willing to write some code to enumerate %PATH% to find git.exe instead of using where.exe. That would fix an additional edge case of having the current directory in PATH with git.exe in it and it also being the cwd.

Resolves: python-poetry/poetry#7320

  • Added tests for changed code.
  • Updated documentation for changed code.

@brycepg brycepg force-pushed the main branch 3 times, most recently from 3db2ea8 to c6fc8c1 Compare December 12, 2023 03:43
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.
@brycepg brycepg changed the title Fix issue with creating new projects Windows Fix issue with creating new projects on Windows Dec 12, 2023
@brycepg
Copy link
Author

brycepg commented Dec 12, 2023

Do we want a regression test?

@radoering
Copy link
Member

Do we want a regression test?

We always want a test if it is feasible. 😄

@Secrus Secrus added the 2.0 PRs for core 2.0 label Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.0 PRs for core 2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Poetry fails to find Git on Windows 10

3 participants