Commit 6a52b1ecd25883a547617d817aed40face3d08a2
- Date: Thu Apr 17 17:07:55 +0000 2008
- Committer: Johan Sørensen (johan@johansorensen.com)
- Author: Johan Sørensen (johan@johansorensen.com)
- Commit SHA1: 6a52b1ecd25883a547617d817aed40face3d08a2
- Tree SHA1: bcd07bdacd26c41163608ef0a0e8ad8b68b8f300
Workaround edgecase where we can't get the last_commit for a given treenode due to weird encodings
Commit diff
| |   |
| 14 | 14 | <% else -%> |
| 15 | 15 | <td class="node file"><%= link_to h(node.basename), blob_path(params[:id], node.name) -%></td> |
| 16 | 16 | <% end -%> |
| 17 | | <% last_commit = commit_for_tree_path(@repository, node.name) -%> |
| 18 | | <td class="meta"><%= last_commit.committed_date.to_s(:short) -%></td> |
| 19 | | <td class="meta commit_message"> |
| 20 | | <%= link_to truncate(h(last_commit.message), 75, "…"), commit_path(last_commit.id) -%> |
| 21 | | </td> |
| 17 | <% if last_commit = commit_for_tree_path(@repository, node.name) -%> |
| 18 | <td class="meta"><%= last_commit.committed_date.to_s(:short) -%></td> |
| 19 | <td class="meta commit_message"> |
| 20 | <%= link_to truncate(h(last_commit.message), 75, "…"), commit_path(last_commit.id) -%> |
| 21 | </td> |
| 22 | <% end -%> |
| 22 | 23 | </tr> |
| 23 | 24 | <% end -%> |
| 24 | 25 | </table> |
| toggle raw diff |
--- a/app/views/trees/show.html.erb
+++ b/app/views/trees/show.html.erb
@@ -14,11 +14,12 @@
<% else -%>
<td class="node file"><%= link_to h(node.basename), blob_path(params[:id], node.name) -%></td>
<% end -%>
- <% last_commit = commit_for_tree_path(@repository, node.name) -%>
- <td class="meta"><%= last_commit.committed_date.to_s(:short) -%></td>
- <td class="meta commit_message">
- <%= link_to truncate(h(last_commit.message), 75, "…"), commit_path(last_commit.id) -%>
- </td>
+ <% if last_commit = commit_for_tree_path(@repository, node.name) -%>
+ <td class="meta"><%= last_commit.committed_date.to_s(:short) -%></td>
+ <td class="meta commit_message">
+ <%= link_to truncate(h(last_commit.message), 75, "…"), commit_path(last_commit.id) -%>
+ </td>
+ <% end -%>
</tr>
<% end -%>
</table> |