diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-02-02 13:36:57 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-02-02 13:36:57 -0800 |
commit | cddbda4bc87b9d2c985b6749b1cf026b15e2d3e7 (patch) | |
tree | 9f50c38a22c7db88038cc061af38f5ebae7cb575 /run-command.c | |
parent | 140d41ae87274303f972702ce394544407d5c21e (diff) | |
parent | 235be51fbecbbdaafd48f762e808c55861e02850 (diff) | |
download | git-cddbda4bc87b9d2c985b6749b1cf026b15e2d3e7.tar.gz |
Merge branch 'js/mingw-hooks-with-exe-suffix'
Names of the various hook scripts must be spelled exactly, but on
Windows, an .exe binary must be named with .exe suffix; notice
$GIT_DIR/hooks/<hookname>.exe as a valid <hookname> hook.
* js/mingw-hooks-with-exe-suffix:
mingw: allow hooks to be .exe files
Diffstat (limited to 'run-command.c')
-rw-r--r-- | run-command.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/run-command.c b/run-command.c index 73bfba7ef9..5227f78aea 100644 --- a/run-command.c +++ b/run-command.c @@ -871,8 +871,14 @@ const char *find_hook(const char *name) strbuf_reset(&path); strbuf_git_path(&path, "hooks/%s", name); - if (access(path.buf, X_OK) < 0) + if (access(path.buf, X_OK) < 0) { +#ifdef STRIP_EXTENSION + strbuf_addstr(&path, STRIP_EXTENSION); + if (access(path.buf, X_OK) >= 0) + return path.buf; +#endif return NULL; + } return path.buf; } |