author | Johannes Sixt <johannes.sixt@telecom.at> | |
Mon, 14 Jan 2008 13:05:33 +0000 (14:05 +0100) | ||
committer | Johannes Sixt <johannes.sixt@telecom.at> | |
Thu, 26 Jun 2008 06:47:16 +0000 (08:47 +0200) | ||
commit | cc3b7a9732f940cb0249a12cb3c02e3d83723eb0 | |
tree | 2943754e9a0cec2e1853db15e4683a00979f2784 | tree | snapshot |
parent | b2f5e2684da060dd821bf90f88df8b6dc9401a40 | commit | diff |
Windows: Make 'git help -a' work.
git help -a scans the PATH for git commands. On Windows it failed for two
reasons:
- The PATH separator is ';', not ':' on Windows.
- stat() does not set the executable bit.
We now open the file and guess whether it is executable.
The result of the guess is good enough for the list of git commands, but
it is of no use for a general stat() implementation because (1) it is a
guess, (2) the user has no way to influence the outcome (via chmod or
similar), and (3) it would reduce stat() performance by an unacceptable
amount. Therefore, this strategy is a special-case local to help.c.
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
git help -a scans the PATH for git commands. On Windows it failed for two
reasons:
- The PATH separator is ';', not ':' on Windows.
- stat() does not set the executable bit.
We now open the file and guess whether it is executable.
The result of the guess is good enough for the list of git commands, but
it is of no use for a general stat() implementation because (1) it is a
guess, (2) the user has no way to influence the outcome (via chmod or
similar), and (3) it would reduce stat() performance by an unacceptable
amount. Therefore, this strategy is a special-case local to help.c.
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
help.c | diff | blob | history |