From 09db8d538297167707eee5c993b527889c0653e0 Mon Sep 17 00:00:00 2001 From: Dave Borowitz Date: Fri, 22 Jul 2016 15:45:08 -0400 Subject: [PATCH] BatchUpdate: Better reimplementation of BatchRefUpdate#toString Change-Id: I4e60bf9b4659e01048976779612f4f122d687551 --- .../java/com/google/gerrit/server/git/BatchUpdate.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/git/BatchUpdate.java b/gerrit-server/src/main/java/com/google/gerrit/server/git/BatchUpdate.java index bd5dbdabf7..5c65441b5d 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/git/BatchUpdate.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/git/BatchUpdate.java @@ -816,7 +816,15 @@ public class BatchUpdate implements AutoCloseable { // ba8eb931734d990c5a6a9352e4629fc84a191808. StringBuilder sb = new StringBuilder("Update failed: [\n"); for (ReceiveCommand cmd2 : bru.getCommands()) { - sb.append(cmd2).append(": ").append(cmd2.getMessage()).append('\n'); + sb.append(" ") + .append(cmd2) + .append(" (") + .append(cmd2.getResult()) + .append(')'); + if (cmd2.getMessage() != null) { + sb.append(": ").append(cmd2.getMessage()); + } + sb.append('\n'); } throw new IOException(sb.append(']').toString()); }