Added one-tree constructor to DirCacheCheckout
When DirCacheCheckout should be used to checkout only one tree (reset --hard, clone) then we had to use the standard constructor and specify null as value for head. This change adds explicit constructors not taking HEAD and documents that. Bug: 330021 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
This commit is contained in:
parent
e8315ce19d
commit
484807e82b
|
@ -144,8 +144,8 @@ public List<String> getRemoved() {
|
|||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
@ -170,9 +170,9 @@ public DirCacheCheckout(Repository repo, ObjectId headCommitTree, DirCache dc,
|
|||
}
|
||||
|
||||
/**
|
||||
* Constructs a DirCacheCeckout for checking out one tree, merging with the
|
||||
* index. As iterator over the working tree this constructor creates a
|
||||
* standard {@link FileTreeIterator}
|
||||
* 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
|
||||
|
@ -184,13 +184,53 @@ public DirCacheCheckout(Repository repo, ObjectId headCommitTree, DirCache dc,
|
|||
* the id of the tree of the
|
||||
* @throws IOException
|
||||
*/
|
||||
public DirCacheCheckout(Repository repo, ObjectId headCommitTree, DirCache dc,
|
||||
ObjectId mergeCommitTree) 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
|
||||
* standard {@link FileTreeIterator}
|
||||
*
|
||||
* @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 of the
|
||||
* @throws IOException
|
||||
*/
|
||||
public DirCacheCheckout(Repository repo, DirCache dc,
|
||||
ObjectId mergeCommitTree) throws IOException {
|
||||
this(repo, null, dc, mergeCommitTree, new FileTreeIterator(
|
||||
repo.getWorkTree(), repo.getFS(),
|
||||
WorkingTreeOptions.createDefaultInstance()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Scan head, index and merge tree. Used during normal checkout or merge
|
||||
* operations.
|
||||
|
|
Loading…
Reference in New Issue