diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java index bc51aa55a..d2629728e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java @@ -144,8 +144,8 @@ public class DirCacheCheckout { } /** - * Constructs a DirCacheCeckout for fast-forwarding from one tree to - * another, merging it with the index + * Constructs a DirCacheCeckout for merging and checking out two trees (HEAD + * and mergeCommitTree) and the index. * * @param repo * the repository in which we do the checkout @@ -169,6 +169,48 @@ public class DirCacheCheckout { this.workingTree = workingTree; } + /** + * Constructs a DirCacheCeckout for merging and checking out two trees (HEAD + * and mergeCommitTree) and the index. As iterator over the working tree + * this constructor creates a standard {@link FileTreeIterator} + * + * @param repo + * the repository in which we do the checkout + * @param headCommitTree + * the id of the tree of the head commit + * @param dc + * the (already locked) Dircache for this repo + * @param mergeCommitTree + * the id of the tree of the + * @throws IOException + */ + public DirCacheCheckout(Repository repo, ObjectId headCommitTree, + DirCache dc, ObjectId mergeCommitTree) throws IOException { + this(repo, headCommitTree, dc, mergeCommitTree, new FileTreeIterator( + repo.getWorkTree(), repo.getFS(), + WorkingTreeOptions.createDefaultInstance())); + } + + /** + * Constructs a DirCacheCeckout for checking out one tree, merging with the + * index. + * + * @param repo + * the repository in which we do the checkout + * @param dc + * the (already locked) Dircache for this repo + * @param mergeCommitTree + * the id of the tree we want to fast-forward to + * @param workingTree + * an iterator over the repositories Working Tree + * @throws IOException + */ + public DirCacheCheckout(Repository repo, DirCache dc, + ObjectId mergeCommitTree, WorkingTreeIterator workingTree) + throws IOException { + this(repo, null, dc, mergeCommitTree, workingTree); + } + /** * Constructs a DirCacheCeckout for checking out one tree, merging with the * index. As iterator over the working tree this constructor creates a @@ -176,17 +218,15 @@ public class DirCacheCheckout { * * @param repo * the repository in which we do the checkout - * @param headCommitTree - * the id of the tree of the head commit * @param dc * the (already locked) Dircache for this repo * @param mergeCommitTree * the id of the tree of the * @throws IOException */ - public DirCacheCheckout(Repository repo, ObjectId headCommitTree, DirCache dc, + public DirCacheCheckout(Repository repo, DirCache dc, ObjectId mergeCommitTree) throws IOException { - this(repo, headCommitTree, dc, mergeCommitTree, new FileTreeIterator( + this(repo, null, dc, mergeCommitTree, new FileTreeIterator( repo.getWorkTree(), repo.getFS(), WorkingTreeOptions.createDefaultInstance())); }