[EGIT PATCH 02/10] Add a toString for debugging to RemoteRefUpdate
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../spearce/jgit/transport/RemoteRefUpdate.java | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteRefUpdate.java b/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteRefUpdate.java
index 9b054eb..8af7d50 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteRefUpdate.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteRefUpdate.java
@@ -299,7 +299,8 @@ public Status getStatus() {
/**
* Check whether update was fast-forward. Note that this result is
- * meaningful only after successful update (when status is {@link Status#OK}).
+ * meaningful only after successful update (when status is {@link Status#OK}
+ * ).
*
* @return true if update was fast-forward; false otherwise.
*/
@@ -341,4 +342,14 @@ protected void updateTrackingRef(final RevWalk walk) throws IOException {
else
trackingRefUpdate.update(walk);
}
+
+ @Override
+ public String toString() {
+ return "RemoteRefUpdate[remoteName=" + remoteName + ", " + status
+ + ", " + (expectedOldObjectId!=null?expectedOldObjectId.abbreviate(localDb).name() :"(null)")
+ + "..." + (newObjectId != null ? newObjectId.abbreviate(localDb).name() : "(null)")
+ + (fastForward ? ", fastForward" : "")
+ + ", srcRef=" + srcRef + (forceUpdate ? ", forceUpdate" : "") + ", message=" + (message != null ? "\""
+ + message + "\"" : "null") + ", " + localDb.getDirectory() + "]";
+ }
}
--
1.6.3.dirty