]> source.dussan.org Git - jgit.git/commitdiff
Add BatchRefUpdate#toString() 87/40387/2
authorDave Borowitz <dborowitz@google.com>
Mon, 26 Jan 2015 19:04:21 +0000 (11:04 -0800)
committerDave Borowitz <dborowitz@google.com>
Tue, 27 Jan 2015 18:04:29 +0000 (10:04 -0800)
Change-Id: I58c342a91911763055c1073d2f426340fbf94fa4

org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java

index b369d0d1f581ea06d60021202f818b84dfcf10be..73850b788988f29c86b716d407bcf5d50f3dc23d 100644 (file)
@@ -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();
+       }
 }