本文整理汇总了Java中org.eclipse.jgit.api.InitCommand.call方法的典型用法代码示例。如果您正苦于以下问题:Java InitCommand.call方法的具体用法?Java InitCommand.call怎么用?Java InitCommand.call使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jgit.api.InitCommand
的用法示例。
在下文中一共展示了InitCommand.call方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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("{")));
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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");
}
示例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);
}
示例8: 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();
}
示例9: 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();
}