-
-
Notifications
You must be signed in to change notification settings - Fork 909
Fix command normalization when a custom env is passed #2677
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
Conversation
pre_commit/parse_shebang.py
Outdated
|
|
||
| def find_executable( | ||
| exe: str, _environ: Mapping[str, str] | None = None, | ||
| exe: str, *, _environ: Mapping[str, str] | None = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it's public it shouldn't be underscored. env is probably what it sounds be called to match subprocess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
411ef96 to
338de08
Compare
| homedir = tempdir_factory.get() | ||
| ret, out = git_commit( | ||
| env={ | ||
| **os.environ, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm why did this need to change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was missing PATHEXT for windows so it couldn't find git. I pushed the right change, it should be good now.
f7fecc1 to
ada060c
Compare
ada060c to
bf1a1fa
Compare
asottile
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.

Custom envs can't be passed to
normalize_cmdwhich causesfind_executableto default toos.environ-- works as expected when injecting directlyos.environ.