aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/treewalk
diff options
context:
space:
mode:
authorChristian Halstrick <christian.halstrick@sap.com>2010-08-16 18:42:24 +0200
committerShawn O. Pearce <spearce@spearce.org>2010-08-18 16:45:56 -0700
commite02b68a8b7c407659995d09fec7044dc366e40a7 (patch)
tree0348d62ae8fe0be45bdc335ecbc633061f814941 /org.eclipse.jgit/src/org/eclipse/jgit/treewalk
parenta85c08e1c8542be8078b5515b7c1f6336410062b (diff)
downloadjgit-e02b68a8b7c407659995d09fec7044dc366e40a7.tar.gz
jgit-e02b68a8b7c407659995d09fec7044dc366e40a7.zip
added resetIndex() to RepositoryTestCase
Added a utility method to set the reset an index to match exactly some content in the filesystem. This can be used by tests to prepare commits in the working-tree and set the index in one shot. [sp: Cleaned up formatting, added getEntryFile(), released inserter.] Change-Id: If38b1f7cacaaf769f51b14541c5da0c1e24568a5 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/treewalk')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/FileTreeIterator.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/FileTreeIterator.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/FileTreeIterator.java
index 2d032ab835..09dd50063f 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/FileTreeIterator.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/FileTreeIterator.java
@@ -211,4 +211,13 @@ public class FileTreeIterator extends WorkingTreeIterator {
public File getDirectory() {
return directory;
}
+
+ /**
+ * @return The location of the working file. This is the same as {@code new
+ * File(getDirectory(), getEntryPath())} but may be faster by
+ * reusing an internal File instance.
+ */
+ public File getEntryFile() {
+ return ((FileEntry) current()).getFile();
+ }
}