Fix RawParseUtils.endOfParagraph to work on all corner cases
commit4327a6726fa0b11ac5fba2b72ebf230438c45343
authorShawn O. Pearce <spearce@spearce.org>
Sun, 10 Aug 2008 08:46:16 +0000 (10 01:46 -0700)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Wed, 13 Aug 2008 19:55:55 +0000 (13 21:55 +0200)
treedc28a6f4830eb56169dda5b2a675400161eacbfc
parentc6e754dd00b4c6486453f4b27e423cf939abf5ff
Fix RawParseUtils.endOfParagraph to work on all corner cases

We rely on this method to find the end of the "oneline" part of a
commit message, which is then used in displays like the History
view in EGit or in some tooltips.  However a number of weird commit
formats were throwing its parsing off, causing us to split the text
in a way we didn't expect (or want) to split it.

This change resolves the splitting by making sure we don't throw an
IndexOutOfBoundsException from RevCommit.getShortMessage due to the
end of the paragraph coming out before the beginning of it.  This
happened sometimes when the commit message was empty.

We also now properly trim the trailing LFs which end the paragraph,
as these were showing up sometimes as spaces at the end of a short
message string (as we do LF->space conversion prior to returning).

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
org.spearce.jgit/src/org/spearce/jgit/util/RawParseUtils.java