Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use bash to open extensionless hooks on windows
Fix gitpython-developers#971. If the hook doesn't have a file extension, then Windows won't know how to run it and you'll get "[WinError 193] %1 is not a valid Win32 application". It's very likely that it's a shell script of some kind, so use bash.exe (commonly installed via Windows Subsystem for Linux). We don't want to run all hooks with bash because they could be .bat files. os.name [seems to be the best way to check for Windows][1] and it should certainly ensure we don't do this on other platforms. [1]: https://stackoverflow.com/questions/1325581/how-do-i-check-if-im-running-on-windows-in-python
- Loading branch information