summaryrefslogtreecommitdiff
path: root/git-send-email.perl
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-05-26 11:21:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-05-27 00:00:59 (GMT)
commit7cbc0455cc07702c5eeff1062c7e2a820758714f (patch)
tree1636a198e362bd08da525356e68a3c0aa1507094 /git-send-email.perl
parent2815326f095a1126fe9b099c311fdde8d7b7b591 (diff)
downloadgit-7cbc0455cc07702c5eeff1062c7e2a820758714f.zip
git-7cbc0455cc07702c5eeff1062c7e2a820758714f.tar.gz
git-7cbc0455cc07702c5eeff1062c7e2a820758714f.tar.bz2
send-email: move "hooks_path" invocation to git-send-email.perl
Move the newly added "hooks_path" API in Git.pm to its only user in git-send-email.perl. This was added in c8243933c74 (git-send-email: Respect core.hooksPath setting, 2021-03-23), meaning that it hasn't yet made it into a non-rc release of git. The consensus with Git.pm is that we need to be considerate of out-of-tree users who treat it as a public documented interface. We should therefore be less willing to add new functionality to it, least we be stuck supporting it after our own uses for it disappear. In this case the git-send-email.perl hook invocation will probably be replaced by a future "git hook run" command, and in the commit preceding this one the "hooks_path" become nothing but a trivial wrapper for "rev-parse --git-path hooks" anyway (with no Cwd::abs_path() call), so let's just inline this command in git-send-email.perl itself. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-xgit-send-email.perl3
1 files changed, 2 insertions, 1 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index 175da07..a454020 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1949,7 +1949,8 @@ sub validate_patch {
my ($fn, $xfer_encoding) = @_;
if ($repo) {
- my $validate_hook = catfile($repo->hooks_path(),
+ my $hooks_path = $repo->command_oneline('rev-parse', '--git-path', 'hooks');
+ my $validate_hook = catfile($hooks_path,
'sendemail-validate');
my $hook_error;
if (-x $validate_hook) {