From b292e2c6c0e5e3a83a4aaf8e7c6c9f6adafabc6c Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 21 Jan 2009 13:14:44 -0700 Subject: [PATCH] Don't show empty last line in annotate view. --- framework/Vcs/lib/Horde/Vcs/Git.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) 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); -- 2.11.0