[PATCH 6] gitweb: Correct error from changing "-|" open to list form in git_commit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Correct error in moving to list form of open for running git commands
and reading their output through pipe (PATCH 2 in series) in
git_commit subroutine.

Signed-off-by: Jakub Narebski <jnareb@xxxxxxxxx>
---
It also simplifies git_commit a tiny bit.

 gitweb/gitweb.cgi |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index e1f0e26..86b9547 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -1984,16 +1984,14 @@ sub git_commit {
 	my %cd = date_str($co{'committer_epoch'}, $co{'committer_tz'});
 
 	my @difftree;
-	my $root = "";
 	my $parent = $co{'parent'};
 	if (!defined $parent) {
-		$root = " --root";
-		$parent = "";
+		$parent = "--root";
 	}
-	open my $fd, "-|", $GIT, "diff-tree", '-r', '-M', $root, $parent, $hash 
+	open my $fd, "-|", $GIT, "diff-tree", '-r', '-M', $parent, $hash 
 		or die_error(undef, "Open git-diff-tree failed.");
 	@difftree = map { chomp; $_ } <$fd>;
-	close $fd or die_error(undef, "Reading diff-tree failed.");
+	close $fd or die_error(undef, "Reading git-diff-tree failed.");
 
 	# non-textual hash id's can be cached
 	my $expires;
-- 
1.4.0

-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]