From baa7fd6c7d951d888e9626b36c164d4740dc6cfb Mon Sep 17 00:00:00 2001 From: James Moger Date: Thu, 29 Mar 2012 17:11:51 -0400 Subject: [PATCH] Ensure that lengthy commit messages are clipped in the header --- src/com/gitblit/wicket/panels/CommitHeaderPanel.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/com/gitblit/wicket/panels/CommitHeaderPanel.java b/src/com/gitblit/wicket/panels/CommitHeaderPanel.java index 1f6ae56f..da9b9ad7 100644 --- a/src/com/gitblit/wicket/panels/CommitHeaderPanel.java +++ b/src/com/gitblit/wicket/panels/CommitHeaderPanel.java @@ -18,6 +18,8 @@ package com.gitblit.wicket.panels; import org.apache.wicket.markup.html.basic.Label; import org.eclipse.jgit.revwalk.RevCommit; +import com.gitblit.Constants; +import com.gitblit.utils.StringUtils; import com.gitblit.wicket.WicketUtils; import com.gitblit.wicket.pages.CommitPage; @@ -35,7 +37,8 @@ public class CommitHeaderPanel extends BasePanel { public CommitHeaderPanel(String id, String repositoryName, RevCommit c) { super(id); - add(new LinkPanel("shortmessage", "title", c.getShortMessage(), CommitPage.class, + add(new LinkPanel("shortmessage", "title", StringUtils.trimString(c.getShortMessage(), + Constants.LEN_SHORTLOG), CommitPage.class, WicketUtils.newObjectParameter(repositoryName, c.getName()))); add(new Label("commitid", "(" + c.getName().substring(0, 8) + ")")); add(new Label("author", c.getAuthorIdent().getName())); -- 2.39.5