[windows] some hooks are tried to be executed even if there is no such a file
For example https://github.com/gitpython-developers/GitPython/blob/0857d33852b6b2f4d7bc470b4c97502c7f978180/git/index/base.py#L941
May be the cause of 703
This is not true - it checks for accessibility inside that function.
Even though this ticket is closed, please feel free to state the underlying problem so people can chime in and help.
This is not true - it checks for accessibility inside that function.
That's strange. Windows 7, 32-bit. On popen it fails with a window appearing saying that the hook file is not a win32 application. In fact there was no such a file at all in the hooks dir.
It is strange indeed. If you can provide a simple python script that reproduces the issue, it truly is a bug worth fixing. Might just be very special behaviour on a OS whose tests are known to be broken for GitPython.
If anyone is still following this, I had a similar error to this, but with run_commit_hook('post-commit', self) instead of pre-commit. What I have done to fix the error is to convert the post-commit file in .git folder to a .bat file. The error of the system complaining that the file is not a Win32 application comes from the fact that Windows doesn't like executing files. This resolution seems a little hacky to me, so if anyone has a better solution that would be great.
I have reopened the issue on account of this seemingly happening on windows, which by now is an entirely untested platform, unfortunately.
Until there is a fix, one might try to use the skip_hooks=true flag when executing IndexFile.commit(...).