Merge branch 'ab/hooks'
A new configuration variable core.hooksPath allows customizing where the hook directory is. * ab/hooks: hooks: allow customizing where the hook directory is githooks.txt: minor improvements to the grammar & phrasing githooks.txt: amend dangerous advice about 'update' hook ACL githooks.txt: improve the intro section
This commit is contained in:
@ -825,7 +825,10 @@ const char *find_hook(const char *name)
|
||||
static struct strbuf path = STRBUF_INIT;
|
||||
|
||||
strbuf_reset(&path);
|
||||
strbuf_git_path(&path, "hooks/%s", name);
|
||||
if (git_hooks_path)
|
||||
strbuf_addf(&path, "%s/%s", git_hooks_path, name);
|
||||
else
|
||||
strbuf_git_path(&path, "hooks/%s", name);
|
||||
if (access(path.buf, X_OK) < 0)
|
||||
return NULL;
|
||||
return path.buf;
|
||||
|
Reference in New Issue
Block a user