]> Sergey Matveev's repositories - public-inbox.git/commitdiff
config: eliminate unnecessary join call up front
authorEric Wong <e@80x24.org>
Sun, 20 Dec 2020 06:30:16 +0000 (06:30 +0000)
committerEric Wong <e@80x24.org>
Sun, 20 Dec 2020 20:39:15 +0000 (20:39 +0000)
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.

lib/PublicInbox/Config.pm

index 199ce0193bbd00cda7389d1ca918e0857cbac4c5..2f5c83cd86c9f9322cca5a14120c6906c7cd73ea 100644 (file)
@@ -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;
 }