diff options
Diffstat (limited to 'run-command.c')
-rw-r--r-- | run-command.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/run-command.c b/run-command.c index e4593cd99b..f5c57a5fc7 100644 --- a/run-command.c +++ b/run-command.c @@ -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; |