about summary refs log tree commit homepage
path: root/lib/PublicInbox/RepobrowseGitAtom.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-01-26 04:27:02 +0000
committerEric Wong <e@80x24.org>2017-01-26 07:55:23 +0000
commitc3288fb27efcca73ba87e27c2c2b41b4a1dfbd46 (patch)
treea4afdc4f8aefc341ad5bbc6c5f7495592e6183c0 /lib/PublicInbox/RepobrowseGitAtom.pm
parent9877e27be55f7a8d00a613630875d647d97d7bb3 (diff)
downloadpublic-inbox-c3288fb27efcca73ba87e27c2c2b41b4a1dfbd46.tar.gz
This shortens the code quite a bit at a negligible performance cost,
and the diffstat agrees.
Diffstat (limited to 'lib/PublicInbox/RepobrowseGitAtom.pm')
-rw-r--r--lib/PublicInbox/RepobrowseGitAtom.pm9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/PublicInbox/RepobrowseGitAtom.pm b/lib/PublicInbox/RepobrowseGitAtom.pm
index 87fc60a7..c610d44d 100644
--- a/lib/PublicInbox/RepobrowseGitAtom.pm
+++ b/lib/PublicInbox/RepobrowseGitAtom.pm
@@ -145,11 +145,10 @@ sub call_git_atom {
         my $env = $req->{env};
         my $q =$req->{'q'} = PublicInbox::RepobrowseGitQuery->new($env);
         my $h = $q->{h};
-        my $git_dir = "--git-dir=$git->{git_dir}";
         my $read_log = sub {
-                my $cmd = ['git', $git_dir,
-                                qw(log --no-notes --no-color --abbrev-commit),
-                                $git->abbrev, $ATOM_FMT, "-$max", $h, '--' ];
+                my $cmd = $git->cmd(qw(log --no-notes --no-color
+                                        --abbrev-commit), $git->abbrev,
+                                        $ATOM_FMT, "-$max", $h, '--');
                 my $expath = $req->{expath};
                 push @$cmd, $expath if $expath ne '';
                 my $rdr = { 2 => $git->err_begin };
@@ -161,7 +160,7 @@ sub call_git_atom {
                 $env->{'qspawn.response'} = $_[0];
                 return $read_log->() if $h ne '';
 
-                my $cmd = [ 'git', $git_dir, qw(symbolic-ref --short HEAD) ];
+                my $cmd = $git->cmd(qw(symbolic-ref --short HEAD));
                 my $rdr = { 2 => $git->err_begin };
                 my $qsp = PublicInbox::Qspawn->new($cmd, undef, undef, $rdr);
                 $qsp->psgi_qx($env, undef, sub {