summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorRobin Stocker2012-09-23 18:01:04 (EDT)
committer Robin Stocker2012-09-23 18:01:04 (EDT)
commit85b189fdbea99e2a5ef8277d314d9962833e263a (patch)
treec31d34d7b9f3d9bea3f76aa5b274c8445a3181fa
parent78c865942849de420592bb822e9e1fd85cc95ade (diff)
downloadjgit-85b189fdbea99e2a5ef8277d314d9962833e263a.zip
jgit-85b189fdbea99e2a5ef8277d314d9962833e263a.tar.gz
jgit-85b189fdbea99e2a5ef8277d314d9962833e263a.tar.bz2
Add toString for TrackingRefUpdaterefs/changes/91/7891/1
Makes it much easier to debug the results of OperationResult#getTrackingRefUpdates (which otherwise requires digging into a TreeMap structure). Change-Id: I90da5385ee47c441404728f252eb3a100c48ee1c
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/TrackingRefUpdate.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TrackingRefUpdate.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TrackingRefUpdate.java
index 3344c3f..d6dcb32 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TrackingRefUpdate.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TrackingRefUpdate.java
@@ -193,4 +193,21 @@ public class TrackingRefUpdate {
}
}
}
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("TrackingRefUpdate[");
+ sb.append(remoteName);
+ sb.append(" -> ");
+ sb.append(localName);
+ if (forceUpdate)
+ sb.append(" (forced)");
+ sb.append(" ");
+ sb.append(oldObjectId == null ? "" : oldObjectId.abbreviate(7).name());
+ sb.append("..");
+ sb.append(newObjectId == null ? "" : newObjectId.abbreviate(7).name());
+ sb.append("]");
+ return sb.toString();
+ }
}