diff options
author | Kevin Sawicki <kevin@github.com> | 2012-01-04 00:27:56 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2012-01-04 00:27:56 +0100 |
commit | 69451b8302e9e46b9b2615de1d5b64c83158ea47 (patch) | |
tree | cb73d0f508e499802a41e94796d8586612258221 | |
parent | d57c00e03696571afd92baf76cce03275b158bef (diff) | |
download | jgit-69451b8302e9e46b9b2615de1d5b64c83158ea47.tar.gz jgit-69451b8302e9e46b9b2615de1d5b64c83158ea47.zip |
Provide file mode of paths in index from IndexDiff
Change-Id: I1d543e2f721987114cc1e1cb0848c234470df794
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java | 11 |
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; + } } |