Browse Source

InitCommand: option to set FS to be used

Change-Id: I95c72f3bdc2da748adbb0d82af72f60650821aab
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
tags/v4.10.0.201712302008-r
Marc Strapetz 6 years ago
parent
commit
0213a71a82
1 changed files with 20 additions and 0 deletions
  1. 20
    0
      org.eclipse.jgit/src/org/eclipse/jgit/api/InitCommand.java

+ 20
- 0
org.eclipse.jgit/src/org/eclipse/jgit/api/InitCommand.java View File

import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.RepositoryBuilder; import org.eclipse.jgit.lib.RepositoryBuilder;
import org.eclipse.jgit.util.FS;
import org.eclipse.jgit.util.SystemReader; import org.eclipse.jgit.util.SystemReader;


/** /**


private boolean bare; private boolean bare;


private FS fs;

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

Loading…
Cancel
Save