summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2014-03-03 17:56:10 -0500
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2014-03-03 17:56:10 -0500
commit1328bfdfeb0b401d2e15e32c605515e1ea02216b (patch)
tree48149e299a9408b17c2ce0e58f46714be6f57220
parent96c049b876425aade7885d2bcea5c8541fbf7356 (diff)
parent21498aec83d4f87563f7218fa100b8c0ecfc9c4a (diff)
downloadjgit-1328bfdfeb0b401d2e15e32c605515e1ea02216b.tar.gz
jgit-1328bfdfeb0b401d2e15e32c605515e1ea02216b.zip
Merge "DirCache.findEntry(byte[], in) made public"
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java28
1 files changed, 20 insertions, 8 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java
index 275dfedebf..f7d6c1780e 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java
@@ -731,13 +731,7 @@ public class DirCache {
/**
* Locate the position a path's entry is at in the index.
- * <p>
- * If there is at least one entry in the index for this path the position of
- * the lowest stage is returned. Subsequent stages can be identified by
- * testing consecutive entries until the path differs.
- * <p>
- * If no path matches the entry -(position+1) is returned, where position is
- * the location it would have gone within the index.
+ * For details refer to #findEntry(byte[], int).
*
* @param path
* the path to search for.
@@ -750,7 +744,25 @@ public class DirCache {
return findEntry(p, p.length);
}
- int findEntry(final byte[] p, final int pLen) {
+ /**
+ * Locate the position a path's entry is at in the index.
+ * <p>
+ * If there is at least one entry in the index for this path the position of
+ * the lowest stage is returned. Subsequent stages can be identified by
+ * testing consecutive entries until the path differs.
+ * <p>
+ * If no path matches the entry -(position+1) is returned, where position is
+ * the location it would have gone within the index.
+ *
+ * @param p
+ * the byte array starting with the path to search for.
+ * @param pLen
+ * the length of the path in bytes
+ * @return if >= 0 then the return value is the position of the entry in the
+ * index; pass to {@link #getEntry(int)} to obtain the entry
+ * information. If < 0 the entry does not exist in the index.
+ */
+ public int findEntry(final byte[] p, final int pLen) {
int low = 0;
int high = entryCnt;
while (low < high) {