* Added a link to the diff of a commit in the commit action.
* Tidied up the "path" stuff in the tree action which is no longer used.
$c->stash(
tree => $tree,
tree_list => [$repository->list_tree($tree->sha1)],
- path => $c->stash->{filename}, # FIXME?
);
};
next;
}
- if (/^index (\w+)\.\.(\w+) (\d+)$/) {
+ if (/^index (\w+)\.\.(\w+)(?: (\d+))?$/) {
@{$ret[-1]}{qw(index src dst mode)} = ($_, $1, $2, $3);
next
}
[% FOREACH item IN diff %]
<h4 id="diff[% loop.count %]" class='diff-head'>diff --git [%# FIXME %]
- <a href='[% c.uri_for_action("/ref/blob", [Repository.name, Commit.sha1], item.file) %]' title="Blob">[% item.a %]</a>
- <a href='[% c.uri_for_action("/ref/blob", [Repository.name, Commit.sha1], item.file) %]' title="Blob">[% item.b %]</a>
+ [% IF !item.src.match('^0+$') %]
+ <a href='[% c.uri_for_action("/ref/blob", [Repository.name, item.src]) %]' title="Blob">[% item.a %]</a>
+ [% ELSE %]
+ [% item.a %]
+ [% END %]
+ [% IF !item.dst.match('^0+$') %]
+ <a href='[% c.uri_for_action("/ref/blob", [Repository.name, item.dst]) %]' title="Blob">[% item.b %]</a>
+ [% ELSE %]
+ [% item.b %]
+ [% END %]
</h4>
-
-
<div class='diff-patch'>
<pre>[% blobs.${loop.index} %]</pre>
</div>
<tr>
<td class='sha1'>[% INCLUDE 'inc/chroma_hash.tt2' sha1 = Commit.sha1.substr(0, 7), hide_sha1_output = 1 %] <div class="sha1_label">Commit</div></td>
<td>[% Commit.sha1 %]</td>
- <td class='action-list'></td>
+ <td class='action-list'><a href="[% c.uri_for_action('/ref/diff_fancy', [Repository.name, Commit.sha1]) %]" title="Difference" class="button diff">diff</a></td>
</tr>
<tr>
<td class='sha1'>[% INCLUDE 'inc/chroma_hash.tt2' sha1 = Commit.tree_sha1.substr(0, 7), hide_sha1_output = 1 %] <div class="sha1_label">Tree</div></td>
- [%
- IF path;
- INCLUDE 'nav/path.tt2' filename = path;
- END;
-
- subinclude('/fragment/ref/tree', c.req.captures, c.req.args.to_path);
- %]
-
+[% subinclude('/fragment/ref/tree', c.req.captures, c.req.args.to_path) %]