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 39f732fce..0da9e4224 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 Set getUntrackedFolders() { return ((indexDiffFilter == null) ? Collections. emptySet() : new HashSet(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; + } }