diff options
author | Marc Strapetz <marc.strapetz@syntevo.com> | 2017-12-13 22:58:14 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2017-12-29 23:46:00 +0100 |
commit | 0213a71a82e3f1a639acc428c2833ac21f305e2c (patch) | |
tree | 2381523e47bbe1d40efe7dbf8b7bb6d47840c548 | |
parent | 243fba9a0ae7e4f6679338c8b7175cc2a0ec06f2 (diff) | |
download | jgit-0213a71a82e3f1a639acc428c2833ac21f305e2c.tar.gz jgit-0213a71a82e3f1a639acc428c2833ac21f305e2c.zip |
InitCommand: option to set FS to be used
Change-Id: I95c72f3bdc2da748adbb0d82af72f60650821aab
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/api/InitCommand.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/InitCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/InitCommand.java index 293d63f5c7..f10bcdfcde 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/InitCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/InitCommand.java @@ -53,6 +53,7 @@ import org.eclipse.jgit.internal.JGitText; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.lib.RepositoryBuilder; +import org.eclipse.jgit.util.FS; import org.eclipse.jgit.util.SystemReader; /** @@ -68,6 +69,8 @@ public class InitCommand implements Callable<Git> { private boolean bare; + private FS fs; + /** * {@inheritDoc} * <p> @@ -79,6 +82,9 @@ public class InitCommand implements Callable<Git> { RepositoryBuilder builder = new RepositoryBuilder(); if (bare) builder.setBare(); + if (fs != null) { + builder.setFS(fs); + } builder.readEnvironment(); if (gitDir != null) builder.setGitDir(gitDir); @@ -194,4 +200,18 @@ public class InitCommand implements Callable<Git> { this.bare = bare; 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 InitCommand setFs(FS fs) { + this.fs = fs; + return this; + } } |