Merge branch 'ab/hooks'

"git rev-parse --git-path hooks/<hook>" learned to take
core.hooksPath configuration variable (introduced during 2.9 cycle)
into account.

* ab/hooks:
  rev-parse: respect core.hooksPath in --git-path
This commit is contained in:
Junio C Hamano
2016-08-19 15:34:16 -07:00
3 changed files with 9 additions and 4 deletions

View File

@ -824,10 +824,7 @@ const char *find_hook(const char *name)
static struct strbuf path = STRBUF_INIT;
strbuf_reset(&path);
if (git_hooks_path)
strbuf_addf(&path, "%s/%s", git_hooks_path, name);
else
strbuf_git_path(&path, "hooks/%s", name);
strbuf_git_path(&path, "hooks/%s", name);
if (access(path.buf, X_OK) < 0)
return NULL;
return path.buf;