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


Java PushCommand.setRemote方法代码示例

本文整理汇总了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());
	}
}
 
开发者ID:SourcePond,项目名称:release-maven-plugin-parent,代码行数:17,代码来源:GitProposedTag.java

示例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());
	}
}
 
开发者ID:SourcePond,项目名称:release-maven-plugin-parent,代码行数:14,代码来源:GitProposedTag.java

示例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();
}
 
开发者ID:danielflower,项目名称:multi-module-maven-release-plugin,代码行数:14,代码来源:LocalGitRepo.java

示例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;
}
 
开发者ID:ivylabs,项目名称:ivy-pdi-git-steps,代码行数:32,代码来源:PushGitCommand.java


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