PushCertificate: Omit null pushee from text representation
Change-Id: Ie9546f2e0e9ee62e0a3c919572153b6076355195
This commit is contained in:
parent
ffa3d4bdb4
commit
94812ef1e9
|
@ -360,6 +360,7 @@ public void testMissingPusheeField() throws Exception {
|
|||
PushCertificate cert = parser.build();
|
||||
assertEquals("0.1", cert.getVersion());
|
||||
assertNull(cert.getPushee());
|
||||
assertFalse(cert.toText().contains(PushCertificateParser.PUSHEE));
|
||||
}
|
||||
|
||||
private static String concatPacketLines(String input, int begin, int end)
|
||||
|
|
|
@ -219,9 +219,11 @@ private StringBuilder toStringBuilder() {
|
|||
StringBuilder sb = new StringBuilder()
|
||||
.append(VERSION).append(' ').append(version).append('\n')
|
||||
.append(PUSHER).append(' ').append(getPusher())
|
||||
.append('\n')
|
||||
.append(PUSHEE).append(' ').append(pushee).append('\n')
|
||||
.append(NONCE).append(' ').append(nonce).append('\n')
|
||||
.append('\n');
|
||||
if (pushee != null) {
|
||||
sb.append(PUSHEE).append(' ').append(pushee).append('\n');
|
||||
}
|
||||
sb.append(NONCE).append(' ').append(nonce).append('\n')
|
||||
.append('\n');
|
||||
for (ReceiveCommand cmd : commands) {
|
||||
sb.append(cmd.getOldId().name())
|
||||
|
|
Loading…
Reference in New Issue