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
This commit is contained in:
@ -871,8 +871,14 @@ const char *find_hook(const char *name)
|
|||||||
|
|
||||||
strbuf_reset(&path);
|
strbuf_reset(&path);
|
||||||
strbuf_git_path(&path, "hooks/%s", name);
|
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 NULL;
|
||||||
|
}
|
||||||
return path.buf;
|
return path.buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user