org.archicontribs.modelrepository.GitHelper.java Source code

Java tutorial

Introduction

Here is the source code for org.archicontribs.modelrepository.GitHelper.java

Source

/**
 * This program and the accompanying materials
 * are made available under the terms of the License
 * which accompanies this distribution in the file LICENSE.txt
 */
package org.archicontribs.modelrepository;

import java.io.File;
import java.io.IOException;

import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.storage.file.FileRepositoryBuilder;

@SuppressWarnings("nls")
public class GitHelper {

    public static Repository createNewRepository(File localPath) throws IOException {
        Repository repository = FileRepositoryBuilder.create(new File(localPath, ".git"));
        repository.create();
        return repository;
    }

}