summaryrefslogtreecommitdiff
path: root/run-command.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-05-17 21:38:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-05-17 21:38:17 (GMT)
commit6675f501f6b987dbdb0dbeb1d2efeb5a27fc41a7 (patch)
tree68e85638e5f5de0d30d1c9881e7f0b5826fe2bca /run-command.c
parentf2c96ceb57afd8c64c3e3e656f9390c95e9fbec9 (diff)
parent867ad08a2610526edb5723804723d371136fc643 (diff)
downloadgit-6675f501f6b987dbdb0dbeb1d2efeb5a27fc41a7.zip
git-6675f501f6b987dbdb0dbeb1d2efeb5a27fc41a7.tar.gz
git-6675f501f6b987dbdb0dbeb1d2efeb5a27fc41a7.tar.bz2
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
Diffstat (limited to 'run-command.c')
-rw-r--r--run-command.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/run-command.c b/run-command.c
index e4593cd..f5c57a5 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;