From: Shawn O. Pearce Date: Mon, 13 Oct 2008 21:10:11 GMT Subject: [JGIT PATCH 2/8] Expose DirCacheEntry.getFileMode as a utility function Message-ID: <1223932217-4771-3-git-send-email-spearce@spearce.org> In-Reply-To: <1223932217-4771-2-git-send-email-spearce@spearce.org> Its easier to get the FileMode object in some applications than to get the raw mode and convert it to the FileMode in the application code. Its slower, but sometimes you just have to have the proper FileMode singleton. Signed-off-by: Shawn O. Pearce --- .../org/spearce/jgit/dircache/DirCacheEntry.java | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/org.spearce.jgit/src/org/spearce/jgit/dircache/DirCacheEntry.java b/org.spearce.jgit/src/org/spearce/jgit/dircache/DirCacheEntry.java index cc683d7..355cd3e 100644 --- a/org.spearce.jgit/src/org/spearce/jgit/dircache/DirCacheEntry.java +++ b/org.spearce.jgit/src/org/spearce/jgit/dircache/DirCacheEntry.java @@ -295,6 +295,15 @@ public int getRawMode() { } /** + * Obtain the {@link FileMode} for this entry. + * + * @return the file mode singleton for this entry. + */ + public FileMode getFileMode() { + return FileMode.fromBits(getRawMode()); + } + + /** * Set the file mode for this entry. * * @param mode -- 1.6.0.2.706.g340fc