]> git.ipfire.org Git - thirdparty/git.git/commitdiff
send-email: refactor sendemail.smtpencryption config parsing
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Fri, 28 May 2021 09:23:43 +0000 (11:23 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 28 May 2021 09:38:07 +0000 (18:38 +0900)
With the removal of the support for sendemail.smtpssl in the preceding
commit the parsing of sendemail.smtpencryption is no longer special,
and can by moved to %config_settings.

This gets us rid of an unconditional call to Git::config(), which as
we'll see in subsequent commits matters for startup performance.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-send-email.perl

index 9a1a4898e36500953fc1e5fd1214de23c317643b..e2fe112aa50ec6b0bf5d2c00226661cc27b9e9c0 100755 (executable)
@@ -287,6 +287,7 @@ my %config_bool_settings = (
 );
 
 my %config_settings = (
+    "smtpencryption" => \$smtp_encryption,
     "smtpserver" => \$smtp_server,
     "smtpserverport" => \$smtp_server_port,
     "smtpserveroption" => \@smtp_server_options,
@@ -387,14 +388,6 @@ sub read_config {
                        $$target = $v;
                }
        }
-
-       if (!defined $smtp_encryption) {
-               my $setting = "$prefix.smtpencryption";
-               my $enc = Git::config(@repo, $setting);
-               return unless defined $enc;
-               return if $configured->{$setting}++;
-               $smtp_encryption = $enc;
-       }
 }
 
 # sendemail.identity yields to --identity. We must parse this