From 23ad3a37638f295e22a67ca16aefeeb53467e289 Mon Sep 17 00:00:00 2001 From: Dave Borowitz Date: Mon, 26 Jan 2015 11:04:21 -0800 Subject: [PATCH] Add BatchRefUpdate#toString() Change-Id: I58c342a91911763055c1073d2f426340fbf94fa4 --- .../src/org/eclipse/jgit/lib/BatchRefUpdate.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java index b369d0d1f..73850b788 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java @@ -394,4 +394,20 @@ public class BatchRefUpdate { return ru; } } + + @Override + public String toString() { + StringBuilder r = new StringBuilder(); + r.append(getClass().getSimpleName()).append('['); + if (commands.isEmpty()) + return r.append(']').toString(); + + r.append('\n'); + for (ReceiveCommand cmd : commands) { + r.append(" "); //$NON-NLS-1$ + r.append(cmd); + r.append(" (").append(cmd.getResult()).append(")\n"); //$NON-NLS-1$ //$NON-NLS-2$ + } + return r.append(']').toString(); + } }