Java 类org.eclipse.jgit.api.InitCommand 实例源码

项目:release-maven-plugin-parent    文件:TestProject.java   
private static TestProject project(final String name) {
    try {
        final File originDir = copyTestProjectToTemporaryLocation(name);
        performPomSubstitution(originDir);

        final InitCommand initCommand = Git.init();
        initCommand.setDirectory(originDir);
        final Git origin = initCommand.call();

        origin.add().addFilepattern(".").call();
        origin.commit().setMessage("Initial commit").call();

        final File localDir = Photocopier.folderForSampleProject(name);
        final Git local = Git.cloneRepository().setBare(false).setDirectory(localDir)
                .setURI(originDir.toURI().toString()).call();

        return new TestProject(originDir, origin, localDir, local);
    } catch (final Exception e) {
        throw new RuntimeException("Error while creating copies of the test project", e);
    }
}
项目:multi-module-maven-release-plugin    文件:TestProject.java   
private static TestProject project(String name) {
    try {
        File originDir = copyTestProjectToTemporaryLocation(name);
        performPomSubstitution(originDir);

        InitCommand initCommand = Git.init();
        initCommand.setDirectory(originDir);
        Git origin = initCommand.call();

        origin.add().addFilepattern(".").call();
        origin.commit().setMessage("Initial commit").call();

        File localDir = Photocopier.folderForSampleProject(name);
        Git local = Git.cloneRepository()
            .setBare(false)
            .setDirectory(localDir)
            .setURI(originDir.toURI().toString())
            .call();

        return new TestProject(originDir, origin, localDir, local);
    } catch (Exception e) {
        throw new RuntimeException("Error while creating copies of the test project", e);
    }
}
项目:raccovery    文件:AccumuloConfigurations.java   
public AccumuloConfigurations(Configuration config) throws Exception {
    Preconditions.checkNotNull(config, "Configuration must be supplied");
    gitDir = new File(config.getDataDir()+"/git");
    LOG.debug("Creating Git repository at {}", gitDir);
    if (!gitDir.exists()) {
        if (!gitDir.mkdir()) {
            throw new IOException("Error creating directory: "+gitDir.getAbsolutePath());
        }
        InitCommand initCommand = Git.init();
        initCommand.setBare(false);
        initCommand.setDirectory(gitDir);
        git = initCommand.call();
        CommitCommand commit = git.commit();
        commit.setMessage("Initial commit").call();
        repo = git.getRepository();
    } else {
        git = Git.open(gitDir);
        repo = git.getRepository();         
    }
    LOG.info("Accumulo configuration store initialized");
}
项目:raccovery    文件:AccumuloConfigurations.java   
public AccumuloConfigurations(Configuration config) throws Exception {
    Preconditions.checkNotNull(config, "Configuration must be supplied");
    gitDir = new File(config.getDataDir()+"/git");
    LOG.debug("Creating Git repository at {}", gitDir);
    if (!gitDir.exists()) {
        if (!gitDir.mkdir()) {
            throw new IOException("Error creating directory: "+gitDir.getAbsolutePath());
        }
        InitCommand initCommand = Git.init();
        initCommand.setBare(false);
        initCommand.setDirectory(gitDir);
        git = initCommand.call();
        CommitCommand commit = git.commit();
        commit.setMessage("Initial commit").call();
        repo = git.getRepository();
    } else {
        git = Git.open(gitDir);
        repo = git.getRepository();         
    }
    LOG.info("Accumulo configuration store initialized");
}
项目:launcher-backend    文件:AbstractGitRepoStep.java   
public static void importNewGitProject(UserDetails userDetails, File basedir, String message, String gitUrl, String branch, String origin, Logger logger) throws GitAPIException {
    GitUtils.disableSslCertificateChecks();
    InitCommand initCommand = Git.init();
    initCommand.setDirectory(basedir);
    Git git = initCommand.call();
    logger.info("Initialised an empty git configuration repo at {}", basedir.getAbsolutePath());
    gitAddCommitAndPush(git, gitUrl, userDetails, basedir, message, branch, origin, logger);
}
项目:fitnesse-git-plugin    文件:GitVersionsControllerFixture.java   
public boolean initialiseGitRepository() throws GitAPIException {
    FileUtil.createDir(VersionsControllerFixture.TEST_DIR);
    new InitCommand()
            .setDirectory(new File(VersionsControllerFixture.TEST_DIR))
            .setBare(false)
            .call();
    return true;
}
项目:ArchiGITPlugin    文件:GitWrapper.java   
public void initialiseGitRepo() throws Exception {
    //FileRepository archiFileRepo = new FileRepository(gitDir);
    InitCommand repoInit = Git.init();
    repoInit.setDirectory(gitDir);
    //repoInit.setBare(true);
    archiRepo = repoInit.call();

}
项目:app-runner    文件:GitCommitTest.java   
private static Git emptyRepo() throws GitAPIException {
    File dir = Photocopier.folderForSampleProject("blah");
    InitCommand initCommand = Git.init();
    initCommand.setDirectory(dir);
    return initCommand.call();
}