зеркало из https://github.com/microsoft/git.git
mingw: allow hooks to be .exe files
Executable files in Windows need to have the extension '.exe', otherwise they do not work. Extend the hooks to not just look at the hard coded names, but also at the names extended by the custom STRIP_EXTENSION, which is defined as '.exe' in Windows. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Родитель
ad36dc8b4b
Коммит
235be51fbe
|
@ -852,8 +852,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;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче