]> source.dussan.org Git - jgit.git/commit
PersonIdent: Strip some special chars from external strings 11/71711/2
authorDave Borowitz <dborowitz@google.com>
Fri, 29 Apr 2016 15:10:36 +0000 (11:10 -0400)
committerDave Borowitz <dborowitz@google.com>
Fri, 29 Apr 2016 15:27:14 +0000 (11:27 -0400)
commit125a8959d2b639dbb8f4665335f369f67c455d74
tree0209ea1663cc0d52bc0e5947168adf12d387d56e
parent773f9661d0634fb3ad69466c0f0ec4d65cb2122d
PersonIdent: Strip some special chars from external strings

The special characters <> and '\n' interfere with parsing of
identities. C git strips these special characters, so we should too.

Rather than allocating extra strings by calling String#trim(), add a
few lines to our sanitization method to perform the same trimming as
described in String's Javadoc.

Change-Id: I96edcb93a2fc194ee354d60566d352299742a52f
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0001_PersonIdentTest.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java