From 09910ffa32e472481a3ba237cf99d803576c9172 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Wed, 21 Jul 2010 10:51:15 +0200 Subject: Move ignore node handling into WorkingTreeIterator The working tree iterator has perfect knowledge of the path structure as well as immediate information about whether or not an ignore file even exists at this level. We can exploit that to simplify the logic and running time for testing ignored file status by pushing all of the checks down into the iterator itself. Change-Id: I22ff534853e8c5672cc5c2d9444aeb14e294070e Signed-off-by: Shawn O. Pearce CC: Charley Wang CC: Chris Aniszczyk CC: Stefan Lay CC: Matthias Sohn --- org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java') diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java index 238d1d287a..23e30ca68b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java @@ -119,8 +119,7 @@ public class AddCommand extends GitCommand { final TreeWalk tw = new TreeWalk(repo); tw.reset(); tw.addTree(new DirCacheBuildIterator(builder)); - FileTreeIterator fileTreeIterator = new FileTreeIterator( - repo.getWorkDir(), repo.getFS()); + FileTreeIterator fileTreeIterator = new FileTreeIterator(repo); tw.addTree(fileTreeIterator); tw.setRecursive(true); tw.setFilter(PathFilterGroup.createFromStrings(filepatterns)); -- cgit v1.2.3