Fixed bug when looking at a commit which is a merge.

When you merge you do not get always a diff of files. This fix correct
that for the case of commit 9a2b8e249a.
This commit is contained in:
Loic d'Anterroches 2008-08-02 09:38:06 +02:00
parent fd6031d7f5
commit 4c5bd8d2be
2 changed files with 5 additions and 1 deletions

View File

@ -46,6 +46,7 @@ class IDF_Diff
$current_chunk = 0; $current_chunk = 0;
$lline = 0; $lline = 0;
$rline = 0; $rline = 0;
$files = array();
foreach ($this->lines as $line) { foreach ($this->lines as $line) {
if (0 === strpos($line, 'diff --git a')) { if (0 === strpos($line, 'diff --git a')) {
$current_file = self::getFile($line); $current_file = self::getFile($line);

View File

@ -17,6 +17,7 @@
<tr> <tr>
<th><strong>{trans 'Message:'}</strong></th><td>{issuetext $cobject.title, $project}{if isset($cobject.full_message)}<br /><br />{issuetext $cobject.full_message, $project}{/if}</td> <th><strong>{trans 'Message:'}</strong></th><td>{issuetext $cobject.title, $project}{if isset($cobject.full_message)}<br /><br />{issuetext $cobject.full_message, $project}{/if}</td>
</tr> </tr>
{if count($diff.files)}
<tr> <tr>
<th><strong>{trans 'Files:'}</strong></th> <th><strong>{trans 'Files:'}</strong></th>
<td> <td>
@ -26,11 +27,13 @@
{/foreach} {/foreach}
</td> </td>
</tr> </tr>
{/if}
</table> </table>
{if count($diff.files)}
<h2>{trans 'Change Details'}</h2> <h2>{trans 'Change Details'}</h2>
{$diff.as_html()|safe} {$diff.as_html()|safe}
{/if}
{/block} {/block}
{block context} {block context}
<p><strong>{trans 'Branches:'}</strong><br /> <p><strong>{trans 'Branches:'}</strong><br />