diff options
Diffstat (limited to 'git-send-email.perl')
| -rwxr-xr-x | git-send-email.perl | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/git-send-email.perl b/git-send-email.perl index f0417f64e7..7fd5874436 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -1355,7 +1355,7 @@ EOF } require Net::SMTP; - my $use_net_smtp_ssl = version->parse($Net::SMTP::VERSION) < version->parse("1.28"); + my $use_net_smtp_ssl = version->parse($Net::SMTP::VERSION) < version->parse("2.34"); $smtp_domain ||= maildomain(); if ($smtp_encryption eq 'ssl') { @@ -1755,21 +1755,23 @@ sub unique_email_list { sub validate_patch { my $fn = shift; - my $validate_hook = catfile(catdir($repo->repo_path(), 'hooks'), - 'sendemail-validate'); - my $hook_error; - if (-x $validate_hook) { - my $target = abs_path($fn); - # The hook needs a correct cwd and GIT_DIR. - my $cwd_save = cwd(); - chdir($repo->wc_path() or $repo->repo_path()) - or die("chdir: $!"); - local $ENV{"GIT_DIR"} = $repo->repo_path(); - $hook_error = "rejected by sendemail-validate hook" - if system($validate_hook, $target); - chdir($cwd_save) or die("chdir: $!"); - } - return $hook_error if $hook_error; + if ($repo) { + my $validate_hook = catfile(catdir($repo->repo_path(), 'hooks'), + 'sendemail-validate'); + my $hook_error; + if (-x $validate_hook) { + my $target = abs_path($fn); + # The hook needs a correct cwd and GIT_DIR. + my $cwd_save = cwd(); + chdir($repo->wc_path() or $repo->repo_path()) + or die("chdir: $!"); + local $ENV{"GIT_DIR"} = $repo->repo_path(); + $hook_error = "rejected by sendemail-validate hook" + if system($validate_hook, $target); + chdir($cwd_save) or die("chdir: $!"); + } + return $hook_error if $hook_error; + } open(my $fh, '<', $fn) or die sprintf(__("unable to open %s: %s\n"), $fn, $!); |
