diff mbox series

[2/2] send-email: honor transferencoding config option again

Message ID xmqqa7fxgxwj.fsf_-_@gitster-ct.c.googlers.com (mailing list archive)
State New, archived
Headers show
Series Re* [PATCH 1/1] send-email: fix transferencoding config option | expand

Commit Message

Junio C Hamano May 8, 2019, 8:20 a.m. UTC
Since e67a228cd8a ("send-email: automatically determine
transfer-encoding"), the value of sendmail.transferencoding in the
configuration file is ignored, because $target_xfer_encoding is
already defined read_config sub parses the configuration file.

Instead of initializing variable $target_xfer_encoding to 'auto' on
definition, we have to set it to the default value of 'auto' if is
undefined after calling read_config() twice to parsing the
configuration files for "sendemail.transferencoding" and
"sendemail.$ident.transferencoding".

This is made trivial by the previous change.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---

 * And this is the second one.  Totally untested, though.

 git-send-email.perl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/git-send-email.perl b/git-send-email.perl
index ca7faff094..7458a0d1ef 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -231,7 +231,7 @@  sub do_edit {
 my (@suppress_cc);
 my ($auto_8bit_encoding);
 my ($compose_encoding);
-my $target_xfer_encoding = 'auto';
+my ($target_xfer_encoding);
 
 my ($debug_net_smtp) = 0;		# Net::SMTP, see send_message()
 
@@ -271,7 +271,7 @@  sub do_edit {
     "from" => [\$sender],
     "assume8bitencoding" => [\$auto_8bit_encoding],
     "composeencoding" => [\$compose_encoding],
-    "transferencoding" => [\$target_xfer_encoding],
+    "transferencoding" => [\$target_xfer_encoding, 'auto'],
 );
 
 my %config_path_settings = (