From c3288fb27efcca73ba87e27c2c2b41b4a1dfbd46 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 26 Jan 2017 04:27:02 +0000 Subject: repobrowse: simplify command generation for git commands This shortens the code quite a bit at a negligible performance cost, and the diffstat agrees. --- lib/PublicInbox/RepobrowseGitTree.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/PublicInbox/RepobrowseGitTree.pm') diff --git a/lib/PublicInbox/RepobrowseGitTree.pm b/lib/PublicInbox/RepobrowseGitTree.pm index a2e38017..c242fd1a 100644 --- a/lib/PublicInbox/RepobrowseGitTree.pm +++ b/lib/PublicInbox/RepobrowseGitTree.pm @@ -189,8 +189,7 @@ sub git_tree_sed ($) { sub git_tree_show { my ($req, $hex, $q) = @_; my $git = $req->{repo_info}->{git}; - my $cmd = [ 'git', "--git-dir=$git->{git_dir}", qw(ls-tree -l -z), - $git->abbrev, $hex ]; + my $cmd = $git->cmd(qw(ls-tree -l -z), $git->abbrev, $hex); my $rdr = { 2 => $git->err_begin }; my $qsp = PublicInbox::Qspawn->new($cmd, undef, $rdr); my $t = cur_path($req, $q); -- cgit v1.2.3-24-ge0c7