Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2012-01-03 23:27:56 +0000
committerMatthias Sohn2012-01-03 23:27:56 +0000
commit69451b8302e9e46b9b2615de1d5b64c83158ea47 (patch)
treecb73d0f508e499802a41e94796d8586612258221 /org.eclipse.jgit
parentd57c00e03696571afd92baf76cce03275b158bef (diff)
downloadjgit-69451b8302e9e46b9b2615de1d5b64c83158ea47.tar.gz
jgit-69451b8302e9e46b9b2615de1d5b64c83158ea47.tar.xz
jgit-69451b8302e9e46b9b2615de1d5b64c83158ea47.zip
Provide file mode of paths in index from IndexDiff
Change-Id: I1d543e2f721987114cc1e1cb0848c234470df794 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java
index 39f732fcef..0da9e4224e 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java
@@ -438,4 +438,15 @@ public class IndexDiff {
return ((indexDiffFilter == null) ? Collections.<String> emptySet()
: new HashSet<String>(indexDiffFilter.getUntrackedFolders()));
}
+
+ /**
+ * Get the file mode of the given path in the index
+ *
+ * @param path
+ * @return file mode
+ */
+ public FileMode getIndexMode(final String path) {
+ final DirCacheEntry entry = dirCache.getEntry(path);
+ return entry != null ? entry.getFileMode() : FileMode.MISSING;
+ }
}

Back to the top