git-send-email: Respect core.hooksPath setting
get-send-email currently makes the assumption that the
'sendemail-validate' hook exists inside of the repository.
Since the introduction of 'core.hooksPath' configuration option in
867ad08a26
(hooks: allow customizing where the hook directory is,
2016-05-04), this is no longer true.
Instead of assuming a hardcoded repo relative path, query
git for the actual path of the hooks directory.
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
1424303384
commit
c8243933c7
13
perl/Git.pm
13
perl/Git.pm
@ -619,6 +619,19 @@ Return path to the git repository. Must be called on a repository instance.
|
||||
|
||||
sub repo_path { $_[0]->{opts}->{Repository} }
|
||||
|
||||
=item hooks_path ()
|
||||
|
||||
Return path to the hooks directory. Must be called on a repository instance.
|
||||
|
||||
=cut
|
||||
|
||||
sub hooks_path {
|
||||
my ($self) = @_;
|
||||
|
||||
my $dir = $self->command_oneline('rev-parse', '--git-path', 'hooks');
|
||||
my $abs = abs_path($dir);
|
||||
return $abs;
|
||||
}
|
||||
|
||||
=item wc_path ()
|
||||
|
||||
|
Reference in New Issue
Block a user