From: Michael M Slusarz Date: Wed, 21 Jan 2009 20:14:44 +0000 (-0700) Subject: Don't show empty last line in annotate view. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=b292e2c6c0e5e3a83a4aaf8e7c6c9f6adafabc6c;p=horde.git Don't show empty last line in annotate view. --- diff --git a/framework/Vcs/lib/Horde/Vcs/Git.php b/framework/Vcs/lib/Horde/Vcs/Git.php index d2446b675..b86c5a0e0 100644 --- a/framework/Vcs/lib/Horde/Vcs/Git.php +++ b/framework/Vcs/lib/Horde/Vcs/Git.php @@ -91,14 +91,16 @@ class Horde_Vcs_Annotate_Git extends Horde_Vcs_Annotate $line = rtrim(fgets($pipe, 4096)); if (!$line || ($line[0] == "\t")) { - $lines[] = array( - 'author' => $db[$curr_rev]['author'] . ' ' . $db[$curr_rev]['author-mail'], - 'date' => $db[$curr_rev]['author-time'], - 'line' => $line ? substr($line, 1) : '', - 'lineno' => $line_num++, - 'rev' => $curr_rev - ); - --$lines_group; + if ($lines_group) { + $lines[] = array( + 'author' => $db[$curr_rev]['author'] . ' ' . $db[$curr_rev]['author-mail'], + 'date' => $db[$curr_rev]['author-time'], + 'line' => $line ? substr($line, 1) : '', + 'lineno' => $line_num++, + 'rev' => $curr_rev + ); + --$lines_group; + } } elseif ($line != 'boundary') { if ($lines_group) { list($prefix, $linedata) = explode(' ', $line, 2);