diff options
author | Arthur Daussy <arthur.daussy@obeo.fr> | 2014-10-31 17:46:36 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2015-11-18 00:28:45 +0100 |
commit | 12280c02dbb8e4ac10893fbbd415be757afab4c1 (patch) | |
tree | 65724c985ead6d5e7c668ceeb30f6d2d61e29d45 /org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java | |
parent | 2f6959d9f31faadcc50b5b0ded25f5e5a11befa4 (diff) | |
download | jgit-12280c02dbb8e4ac10893fbbd415be757afab4c1.tar.gz jgit-12280c02dbb8e4ac10893fbbd415be757afab4c1.zip |
Adds the git attributes computation on the treewalk
Adds the getAttributes feature to the tree walk. The computation of
attributes needs to be done by the TreeWalk since it needs both a
WorkingTreeIterator and a DirCacheIterator.
Bug: 342372
CQ: 9120
Change-Id: I5e33257fd8c9895869a128bad3fd1e720409d361
Signed-off-by: Arthur Daussy <arthur.daussy@obeo.fr>
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java | 3 |
1 files changed, 3 insertions, 0 deletions
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 de6c32a808..ae297a6438 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java @@ -63,6 +63,7 @@ import org.eclipse.jgit.lib.ObjectInserter; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.treewalk.FileTreeIterator; import org.eclipse.jgit.treewalk.TreeWalk; +import org.eclipse.jgit.treewalk.TreeWalk.OperationType; import org.eclipse.jgit.treewalk.WorkingTreeIterator; import org.eclipse.jgit.treewalk.filter.PathFilterGroup; @@ -139,6 +140,7 @@ public class AddCommand extends GitCommand<DirCache> { try (ObjectInserter inserter = repo.newObjectInserter(); final TreeWalk tw = new TreeWalk(repo)) { + tw.setOperationType(OperationType.CHECKIN_OP); dc = repo.lockDirCache(); DirCacheIterator c; @@ -146,6 +148,7 @@ public class AddCommand extends GitCommand<DirCache> { tw.addTree(new DirCacheBuildIterator(builder)); if (workingTreeIterator == null) workingTreeIterator = new FileTreeIterator(repo); + workingTreeIterator.setDirCacheIterator(tw, 0); tw.addTree(workingTreeIterator); tw.setRecursive(true); if (!addAll) |