Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto Tyley2011-01-26 13:25:10 +0000
committerChris Aniszczyk2011-01-27 04:03:41 +0000
commit6ac8279ae7b05faadce88951bb26bdb04c1fcca1 (patch)
treec945d03fe2598d50032af98d34b5682fb3a53329
parent24e7f0f6fa36d96986f63178fc239ec07d221b6b (diff)
downloadjgit-6ac8279ae7b05faadce88951bb26bdb04c1fcca1.tar.gz
jgit-6ac8279ae7b05faadce88951bb26bdb04c1fcca1.tar.xz
jgit-6ac8279ae7b05faadce88951bb26bdb04c1fcca1.zip
Provide access to the Refs of a PlotCommit
This information is generally useful - have followed the accessor pattern of 'children' and 'parents' Change-Id: I79b3ddd6f390152aa49e6b7a4c72a4aca0d6bc72 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java
index dc9e0321f5..1e22416f24 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java
@@ -145,6 +145,29 @@ public class PlotCommit<L extends PlotLane> extends RevCommit {
}
/**
+ * Get the number of refs for this commit.
+ *
+ * @return number of refs; always a positive value but can be 0.
+ */
+ public final int getRefCount() {
+ return refs.length;
+ }
+
+ /**
+ * Get the nth Ref from this commit's ref list.
+ *
+ * @param nth
+ * ref index to obtain. Must be in the range 0 through
+ * {@link #getRefCount()}-1.
+ * @return the specified ref.
+ * @throws ArrayIndexOutOfBoundsException
+ * an invalid ref index was specified.
+ */
+ public final Ref getRef(final int nth) {
+ return refs[nth];
+ }
+
+ /**
* Obtain the lane this commit has been plotted into.
*
* @return the assigned lane for this commit.

Back to the top