diff options
author | Marc Strapetz <marc.strapetz@syntevo.com> | 2017-12-13 23:01:37 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2017-12-29 23:46:01 +0100 |
commit | de49edbffb15bbc4daa39b3387dce47d71bc8fef (patch) | |
tree | 2df87065a1d34d5118b0b40f18ac267d4fb21b0f /org.eclipse.jgit | |
parent | 0213a71a82e3f1a639acc428c2833ac21f305e2c (diff) | |
download | jgit-de49edbffb15bbc4daa39b3387dce47d71bc8fef.tar.gz jgit-de49edbffb15bbc4daa39b3387dce47d71bc8fef.zip |
CloneCommand: option to set FS to be used
Change-Id: If8342974d07b7d89a6c5721a6dd03826886aa89e
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java index 1601a5dfca..6d3afc619a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java @@ -78,6 +78,7 @@ import org.eclipse.jgit.transport.RemoteConfig; import org.eclipse.jgit.transport.TagOpt; import org.eclipse.jgit.transport.URIish; import org.eclipse.jgit.util.FileUtils; +import org.eclipse.jgit.util.FS; /** * Clone a repository into a new working directory @@ -95,6 +96,8 @@ public class CloneCommand extends TransportCommand<CloneCommand, Git> { private boolean bare; + private FS fs; + private String remote = Constants.DEFAULT_REMOTE_NAME; private String branch = Constants.HEAD; @@ -259,6 +262,9 @@ public class CloneCommand extends TransportCommand<CloneCommand, Git> { private Repository init() throws GitAPIException { InitCommand command = Git.init(); command.setBare(bare); + if (fs != null) { + command.setFs(fs); + } if (directory != null) { command.setDirectory(directory); } @@ -519,6 +525,20 @@ public class CloneCommand extends TransportCommand<CloneCommand, Git> { } /** + * 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 * clone operation. If no remote name is set, the default value of * <code>Constants.DEFAULT_REMOTE_NAME</code> will be used. |