Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRĂ¼diger Herrmann2014-10-17 11:05:41 +0000
committerMatthias Sohn2015-01-02 23:28:15 +0000
commita4c2c8a3eea8a28b34e298f5ef3ccbd56dd87fac (patch)
tree119dd60e20990293f8354a54011b992cbdf52cb8 /org.eclipse.jgit
parent1cb566844116fc280969e4a89be8fa1c6e3a7d72 (diff)
downloadjgit-a4c2c8a3eea8a28b34e298f5ef3ccbd56dd87fac.tar.gz
jgit-a4c2c8a3eea8a28b34e298f5ef3ccbd56dd87fac.tar.xz
jgit-a4c2c8a3eea8a28b34e298f5ef3ccbd56dd87fac.zip
Trim author/committer name and email in commit header
C Git trims name and email before inserting them into the commit header so that " A U Thor " and " author@example.com " becomes "A U Thor <author@example.com>" with a single separating space. This changes PersonIdent#toExternalString() to trim name and email before concatenating them. Change-Id: Idd77b659d0db957626824f6632e2da38d7731625 Signed-off-by: RĂ¼diger Herrmann <ruediger.herrmann@gmx.de>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java
index 69f7fd4404..8f7e3eff7c 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java
@@ -254,9 +254,9 @@ public class PersonIdent implements Serializable {
*/
public String toExternalString() {
final StringBuilder r = new StringBuilder();
- r.append(getName());
+ r.append(getName().trim());
r.append(" <"); //$NON-NLS-1$
- r.append(getEmailAddress());
+ r.append(getEmailAddress().trim());
r.append("> "); //$NON-NLS-1$
r.append(when / 1000);
r.append(' ');

Back to the top