当前位置: 首页>>代码示例>>Java>>正文


Java InitCommand类代码示例

本文整理汇总了Java中org.eclipse.jgit.api.InitCommand的典型用法代码示例。如果您正苦于以下问题:Java InitCommand类的具体用法?Java InitCommand怎么用?Java InitCommand使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


InitCommand类属于org.eclipse.jgit.api包,在下文中一共展示了InitCommand类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: create

import org.eclipse.jgit.api.InitCommand; //导入依赖的package包/类
public static AppRepo create(String name, File originDir) {
    try {
        InitCommand initCommand = Git.init();
        initCommand.setDirectory(originDir);
        Git origin = initCommand.call();

        origin.add().addFilepattern(".").call();
        origin.commit().setMessage("Initial commit")
            .setAuthor(new PersonIdent("Author Test", "[email protected]"))
            .call();

        return new AppRepo(name, originDir, origin);
    } catch (Exception e) {
        throw new RuntimeException("Error while creating git repo", e);
    }
}
 
开发者ID:danielflower,项目名称:app-runner-router,代码行数:17,代码来源:AppRepo.java

示例2: pushingAnEmptyRepoIsRejected

import org.eclipse.jgit.api.InitCommand; //导入依赖的package包/类
@Test
public void pushingAnEmptyRepoIsRejected() throws Exception {
    File dir = Photocopier.folderForSampleProject("empty-project");
    InitCommand initCommand = Git.init();
    initCommand.setDirectory(dir);
    Git origin = initCommand.call();

    ContentResponse resp = restClient.createApp(dir.toURI().toString(), "empty-project");
    assertThat(resp, equalTo(501, containsString("No suitable runner found for this app")));

    Photocopier.copySampleAppToDir("maven", dir);
    origin.add().addFilepattern(".").call();
    origin.commit().setMessage("Initial commit")
        .setAuthor(new PersonIdent("Author Test", "[email protected]"))
        .call();

    resp = restClient.createApp(dir.toURI().toString(), "empty-project");
    assertThat(resp, equalTo(201, containsString("empty-project")));
    assertThat(new JSONObject(resp.getContentAsString()).get("name"), Matchers.equalTo("empty-project"));
    assertThat(restClient.deleteApp("empty-project"), equalTo(200, containsString("{")));
}
 
开发者ID:danielflower,项目名称:app-runner,代码行数:22,代码来源:SystemTest.java

示例3: create

import org.eclipse.jgit.api.InitCommand; //导入依赖的package包/类
public static AppRepo create(String name) {
    try {
        File originDir = copySampleAppToTempDir(name);

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

        origin.add().addFilepattern(".").call();
        origin.commit().setMessage("Initial commit")
            .setAuthor(new PersonIdent("Author Test", "[email protected]"))
            .call();

        return new AppRepo(name, originDir, origin);
    } catch (Exception e) {
        throw new RuntimeException("Error while creating git repo", e);
    }
}
 
开发者ID:danielflower,项目名称:app-runner,代码行数:19,代码来源:AppRepo.java

示例4: project

import org.eclipse.jgit.api.InitCommand; //导入依赖的package包/类
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);
	}
}
 
开发者ID:SourcePond,项目名称:release-maven-plugin-parent,代码行数:22,代码来源:TestProject.java

示例5: project

import org.eclipse.jgit.api.InitCommand; //导入依赖的package包/类
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);
    }
}
 
开发者ID:danielflower,项目名称:multi-module-maven-release-plugin,代码行数:25,代码来源:TestProject.java

示例6: AccumuloConfigurations

import org.eclipse.jgit.api.InitCommand; //导入依赖的package包/类
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");
}
 
开发者ID:dlmarion,项目名称:raccovery,代码行数:22,代码来源:AccumuloConfigurations.java

示例7: importNewGitProject

import org.eclipse.jgit.api.InitCommand; //导入依赖的package包/类
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);
}
 
开发者ID:fabric8-launcher,项目名称:launcher-backend,代码行数:9,代码来源:AbstractGitRepoStep.java

示例8: initialiseGitRepository

import org.eclipse.jgit.api.InitCommand; //导入依赖的package包/类
public boolean initialiseGitRepository() throws GitAPIException {
    FileUtil.createDir(VersionsControllerFixture.TEST_DIR);
    new InitCommand()
            .setDirectory(new File(VersionsControllerFixture.TEST_DIR))
            .setBare(false)
            .call();
    return true;
}
 
开发者ID:fitnesse,项目名称:fitnesse-git-plugin,代码行数:9,代码来源:GitVersionsControllerFixture.java

示例9: initialiseGitRepo

import org.eclipse.jgit.api.InitCommand; //导入依赖的package包/类
public void initialiseGitRepo() throws Exception {
	//FileRepository archiFileRepo = new FileRepository(gitDir);
	InitCommand repoInit = Git.init();
	repoInit.setDirectory(gitDir);
	//repoInit.setBare(true);
	archiRepo = repoInit.call();
	
}
 
开发者ID:CymaLtd,项目名称:ArchiGITPlugin,代码行数:9,代码来源:GitWrapper.java

示例10: emptyRepo

import org.eclipse.jgit.api.InitCommand; //导入依赖的package包/类
private static Git emptyRepo() throws GitAPIException {
    File dir = Photocopier.folderForSampleProject("blah");
    InitCommand initCommand = Git.init();
    initCommand.setDirectory(dir);
    return initCommand.call();
}
 
开发者ID:danielflower,项目名称:app-runner,代码行数:7,代码来源:GitCommitTest.java


注:本文中的org.eclipse.jgit.api.InitCommand类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。