From: Eric Wong Date: Sun, 20 Dec 2020 06:30:16 +0000 (+0000) Subject: config: eliminate unnecessary join call up front X-Git-Tag: v1.7.0~1524 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=fb7d958dbc601f126dc391d915f5935d4cfc595e;p=public-inbox.git config: eliminate unnecessary join call up front We can rely on implicit join in string interpolation on die() iff needed. And just creating the arrayref up front to avoid an extra backslash seems nicer at the moment. --- diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm index 199ce019..2f5c83cd 100644 --- a/lib/PublicInbox/Config.pm +++ b/lib/PublicInbox/Config.pm @@ -163,11 +163,10 @@ sub config_fh_parse ($$$) { sub git_config_dump { my ($file) = @_; return {} unless -e $file; - my @cmd = (qw/git config -z -l --includes/, "--file=$file"); - my $cmd = join(' ', @cmd); - my $fh = popen_rd(\@cmd); + my $cmd = [ qw(git config -z -l --includes), "--file=$file" ]; + my $fh = popen_rd($cmd); my $rv = config_fh_parse($fh, "\0", "\n"); - close $fh or die "failed to close ($cmd) pipe: $?"; + close $fh or die "failed to close (@$cmd) pipe: $?"; $rv; }