本文整理汇总了Java中org.eclipse.jgit.api.PushCommand.setRemote方法的典型用法代码示例。如果您正苦于以下问题:Java PushCommand.setRemote方法的具体用法?Java PushCommand.setRemote怎么用?Java PushCommand.setRemote使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jgit.api.PushCommand
的用法示例。
在下文中一共展示了PushCommand.setRemote方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: delete
import org.eclipse.jgit.api.PushCommand; //导入方法依赖的package包/类
@Override
public void delete() throws SCMException {
try {
final List<String> deleted = git.tagDelete().setTags(name()).call();
if (!deleted.isEmpty()) {
final PushCommand pushCommand = git.push().add(":refs/tags/" + name());
if (remoteUrlOrNull != null) {
pushCommand.setRemote(remoteUrlOrNull);
}
pushAndLogResult(pushCommand);
}
log.info(String.format("Deleted tag '%s' from repository", name()));
} catch (final GitAPIException e) {
throw new SCMException(e, "Remote tag '%s' could not be deleted!", name());
}
}
示例2: tagAndPush
import org.eclipse.jgit.api.PushCommand; //导入方法依赖的package包/类
@Override
public void tagAndPush() throws SCMException {
log.info(String.format("About to tag the repository with %s", name()));
try {
final PushCommand pushCommand = git.push().add(saveAtHEAD());
if (remoteUrlOrNull != null) {
pushCommand.setRemote(remoteUrlOrNull);
}
pushAndLogResult(pushCommand);
} catch (final GitAPIException e) {
throw new SCMException(e, "Tag '%s' could not be pushed!", name());
}
}
示例3: pushTags
import org.eclipse.jgit.api.PushCommand; //导入方法依赖的package包/类
@Override
public void pushTags(Collection<AnnotatedTag> tags) throws GitAPIException {
PushCommand pushCommand = git.push();
if (remoteUrl != null) {
pushCommand.setRemote(remoteUrl);
}
for (AnnotatedTag tag : tags) {
pushCommand.add(tag.saveAtHEAD(git));
}
pushCommand.call();
}
示例4: call
import org.eclipse.jgit.api.PushCommand; //导入方法依赖的package包/类
public Git call(final GitOperationsStep gitOperationsStep, Git git,
CredentialsProvider cp, String gitRepoUrl, File gitRepoFolder)
throws IllegalArgumentException, IOException,
InvalidRemoteException, TransportException, GitAPIException {
PushCommand pc = git.push().setDryRun(dryRun).setForce(force)
.setThin(thin);
if (cp != null) {
pc = pc.setCredentialsProvider(cp);
}
if (!Const.isEmpty(this.receivePack)) {
pc = pc.setReceivePack(gitOperationsStep
.environmentSubstitute(receivePack));
}
if (!Const.isEmpty(this.referenceToPush)) {
pc = pc.add(gitOperationsStep
.environmentSubstitute(this.referenceToPush));
}
if (!Const.isEmpty(this.remote)) {
pc = pc.setRemote(gitOperationsStep
.environmentSubstitute(this.remote));
}
if (this.pushAllBranches) {
pc = pc.setPushAll();
}
if (this.pushAllTags) {
pc = pc.setPushTags();
}
pc.call();
return git;
}