NoteDb: Fix conversion of PatchSet.pushCertificate field

RevisionNote was excluding the trailing newline from the push cert
parsed out of the note, even though it was present in NoteDb. Include
the newline so they match. However, this diff is spurious anyway--
OpenPGP parsers don't care whether there are trailing newlines. So
harden ChangeBundle against trailing newlines not matching as well.

Change-Id: Idc85ab226040ab2e507cf7a83c0b4cd5286ffb58
This commit is contained in:
Dave Borowitz
2016-04-28 12:50:31 -04:00
parent f882dccb47
commit d72ef55b0d
5 changed files with 80 additions and 8 deletions

View File

@@ -37,7 +37,7 @@ class RevisionNote {
"certificate version ".getBytes(UTF_8);
// See org.eclipse.jgit.transport.PushCertificateParser.END_SIGNATURE
private static final byte[] END_SIGNATURE =
"-----END PGP SIGNATURE-----".getBytes(UTF_8);
"-----END PGP SIGNATURE-----\n".getBytes(UTF_8);
private static void trimLeadingEmptyLines(byte[] bytes, MutableInteger p) {
while (p.value < bytes.length && bytes[p.value] == '\n') {