CloneCommand: option to set FS to be used
Change-Id: If8342974d07b7d89a6c5721a6dd03826886aa89e Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
This commit is contained in:
parent
0213a71a82
commit
de49edbffb
|
@ -78,6 +78,7 @@
|
||||||
import org.eclipse.jgit.transport.TagOpt;
|
import org.eclipse.jgit.transport.TagOpt;
|
||||||
import org.eclipse.jgit.transport.URIish;
|
import org.eclipse.jgit.transport.URIish;
|
||||||
import org.eclipse.jgit.util.FileUtils;
|
import org.eclipse.jgit.util.FileUtils;
|
||||||
|
import org.eclipse.jgit.util.FS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clone a repository into a new working directory
|
* Clone a repository into a new working directory
|
||||||
|
@ -95,6 +96,8 @@ public class CloneCommand extends TransportCommand<CloneCommand, Git> {
|
||||||
|
|
||||||
private boolean bare;
|
private boolean bare;
|
||||||
|
|
||||||
|
private FS fs;
|
||||||
|
|
||||||
private String remote = Constants.DEFAULT_REMOTE_NAME;
|
private String remote = Constants.DEFAULT_REMOTE_NAME;
|
||||||
|
|
||||||
private String branch = Constants.HEAD;
|
private String branch = Constants.HEAD;
|
||||||
|
@ -259,6 +262,9 @@ void verifyDirectories(URIish u) {
|
||||||
private Repository init() throws GitAPIException {
|
private Repository init() throws GitAPIException {
|
||||||
InitCommand command = Git.init();
|
InitCommand command = Git.init();
|
||||||
command.setBare(bare);
|
command.setBare(bare);
|
||||||
|
if (fs != null) {
|
||||||
|
command.setFs(fs);
|
||||||
|
}
|
||||||
if (directory != null) {
|
if (directory != null) {
|
||||||
command.setDirectory(directory);
|
command.setDirectory(directory);
|
||||||
}
|
}
|
||||||
|
@ -518,6 +524,20 @@ public CloneCommand setBare(boolean bare) throws IllegalStateException {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the file system abstraction to be used for repositories created by
|
||||||
|
* this command.
|
||||||
|
*
|
||||||
|
* @param fs
|
||||||
|
* the abstraction.
|
||||||
|
* @return {@code this} (for chaining calls).
|
||||||
|
* @since 4.10
|
||||||
|
*/
|
||||||
|
public CloneCommand setFs(FS fs) {
|
||||||
|
this.fs = fs;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The remote name used to keep track of the upstream repository for the
|
* The remote name used to keep track of the upstream repository for the
|
||||||
* clone operation. If no remote name is set, the default value of
|
* clone operation. If no remote name is set, the default value of
|
||||||
|
|
Loading…
Reference in New Issue