Johannes Schindelin <johannes.schindelin@xxxxxx> writes: > From: Heiko Voigt <hvoigt@xxxxxxxxxx> > > On Windows, executables need to have the file extension `.exe`, or they > are not executables. Hence, to support scripts, Git for Windows also > looks for a she-bang line by opening the file in question, and executing > it via the specified script interpreter. > > To figure out whether files in the `PATH` are executable, `git help` has > code that imitates this behavior. With one exception: it *always* opens > the files and looks for a she-bang line *or* an `MZ` tell-tale > (nevermind that files with the magic `MZ` but without file extension > `.exe` would still not be executable). > > Opening this many files leads to performance problems that are even more > serious when a virus scanner is running. Therefore, let's change the > code to look for the file extension `.exe` early, and avoid opening the > file altogether if we already know that it is executable. Much more readable than the initial round. Will queue; thanks.