Example usage for org.eclipse.jgit.internal.storage.file FileRepository create

List of usage examples for org.eclipse.jgit.internal.storage.file FileRepository create

Introduction

In this page you can find the example usage for org.eclipse.jgit.internal.storage.file FileRepository create.

Prototype

@Override
public void create(boolean bare) throws IOException 

Source Link

Document

Create a new Git repository initializing the necessary files and directories.

Usage

From source file:svnserver.repository.git.GitCreateMode.java

License:GNU General Public License

protected static Repository createRepository(@NotNull File file) throws IOException {
    if (file.exists() || file.mkdirs()) {
        final FileRepository repository = new FileRepository(file);
        repository.create(true);
        return repository;
    }/* w  w w . ja va 2 s.c  o  m*/
    throw new FileNotFoundException(file.getPath());
}