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;
/**
private boolean bare;
+ private FS fs;
+
/**
* {@inheritDoc}
* <p>
RepositoryBuilder builder = new RepositoryBuilder();
if (bare)
builder.setBare();
+ if (fs != null) {
+ builder.setFS(fs);
+ }
builder.readEnvironment();
if (gitDir != null)
builder.setGitDir(gitDir);
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;
+ }
}