本文整理了Java中org.eclipse.jgit.api.Git.cherryPick()
方法的一些代码示例,展示了Git.cherryPick()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Git.cherryPick()
方法的具体详情如下:
包路径:org.eclipse.jgit.api.Git
类名称:Git
方法名:cherryPick
[英]Return a command object to execute a cherry-pick command
[中]返回一个命令对象以执行cherry pick命令
代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit
CherryPickResult cherryPickResult = git.cherryPick()
.include(commitToPick).setOurCommitName(ourCommitName)
.setReflogPrefix(REFLOG_PREFIX).setStrategy(strategy)
代码示例来源:origin: org.jboss.forge.addon/git-impl
@Override
public void cherryPick(final Git repo, Ref commit) throws GitAPIException
{
repo.cherryPick().include(commit).call();
}
代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit
boolean isMerge = commitToPick.getParentCount() > 1;
String ourCommitName = getOurCommitName();
CherryPickCommand pickCommand = git.cherryPick()
.include(commitToPick)
.setOurCommitName(ourCommitName)
代码示例来源:origin: org.apereo.cas/cas-mgmt-support-version-control
/**
* Cherry picks a single commit to be merge in the current branch.
*
* @param commit - RevCommit to be included.
* @throws GitAPIException - failed.
*/
public void cherryPickCommit(final RevCommit commit) throws GitAPIException {
git.cherryPick().include(commit).setNoCommit(true).call();
}
代码示例来源:origin: org.apache.camel/camel-git
protected void doCherryPick(Exchange exchange, String operation) throws Exception {
CherryPickResult result = null;
String commitId = null;
try {
if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(GitConstants.GIT_COMMIT_ID))) {
commitId = exchange.getIn().getHeader(GitConstants.GIT_COMMIT_ID, String.class);
} else {
throw new IllegalArgumentException("Commit id must be specified to execute " + operation);
}
RevWalk walk = new RevWalk(repo);
ObjectId id = repo.resolve(commitId);
RevCommit commit = walk.parseCommit(id);
walk.dispose();
if (ObjectHelper.isNotEmpty(endpoint.getBranchName())) {
git.checkout().setCreateBranch(false).setName(endpoint.getBranchName()).call();
}
result = git.cherryPick().include(commit).call();
} catch (Exception e) {
LOG.error("There was an error in Git {} operation", operation);
throw e;
}
updateExchange(exchange, result);
}
代码示例来源:origin: sheimi/SGit
public boolean cherrypick() {
try {
ObjectId commit = mRepo.getGit().getRepository()
.resolve(mCommitStr);
mRepo.getGit().cherryPick().include(commit).call();
} catch (StopTaskException e) {
return false;
} catch (Throwable e) {
setException(e);
return false;
}
return true;
}
}
代码示例来源:origin: maks/MGit
public boolean cherrypick() {
try {
ObjectId commit = mRepo.getGit().getRepository()
.resolve(mCommitStr);
mRepo.getGit().cherryPick().include(commit).call();
} catch (StopTaskException e) {
return false;
} catch (Throwable e) {
setException(e);
return false;
}
return true;
}
}
代码示例来源:origin: io.fabric8.patch/patch-management
fork.cherryPick()
.include(fork.getRepository().resolve(patchRef))
.setNoCommit(true)
RevCommit userChange = it.previous();
String prefix = String.format("%0" + prefixSize + "d-%s", count++, userChange.getName());
CherryPickResult result = fork.cherryPick()
.include(userChange)
.setNoCommit(true)
CherryPickResult result = fork.cherryPick()
.include(commit)
.setNoCommit(true)
代码示例来源:origin: jboss-fuse/fabric8
fork.cherryPick()
.include(fork.getRepository().resolve(patchRef))
.setNoCommit(true)
RevCommit userChange = it.previous();
String prefix = String.format("%0" + prefixSize + "d-%s", count++, userChange.getName());
CherryPickResult result = fork.cherryPick()
.include(userChange)
.setNoCommit(true)
CherryPickResult result = fork.cherryPick()
.include(commit)
.setNoCommit(true)
代码示例来源:origin: io.fabric8.patch/patch-management
RevCommit userChange = it.previous();
String prefix = String.format("%0" + prefixSize + "d-%s", count++, userChange.getName());
CherryPickResult result = fork.cherryPick()
.include(userChange)
.setNoCommit(true)
代码示例来源:origin: jboss-fuse/fabric8
RevCommit userChange = it.previous();
String prefix = String.format("%0" + prefixSize + "d-%s", count++, userChange.getName());
CherryPickResult result = fork.cherryPick()
.include(userChange)
.setNoCommit(true)
代码示例来源:origin: io.fabric8.patch/patch-management
CherryPickResult cpr = fork.cherryPick()
.include(userChange.getId())
.setNoCommit(true)
代码示例来源:origin: jboss-fuse/fabric8
CherryPickResult cpr = fork.cherryPick()
.include(userChange.getId())
.setNoCommit(true)
代码示例来源:origin: sonia.jgit/org.eclipse.jgit
CherryPickResult cherryPickResult = git.cherryPick()
.include(commitToPick).setOurCommitName(ourCommitName)
.setReflogPrefix(REFLOG_PREFIX).setStrategy(strategy)
代码示例来源:origin: berlam/github-bucket
CherryPickResult cherryPickResult = git.cherryPick()
.include(commitToPick).setOurCommitName(ourCommitName)
.setReflogPrefix(REFLOG_PREFIX).setStrategy(strategy)
代码示例来源:origin: berlam/github-bucket
boolean isMerge = commitToPick.getParentCount() > 1;
String ourCommitName = getOurCommitName();
CherryPickCommand pickCommand = git.cherryPick()
.include(commitToPick)
.setOurCommitName(ourCommitName)
代码示例来源:origin: sonia.jgit/org.eclipse.jgit
boolean isMerge = commitToPick.getParentCount() > 1;
String ourCommitName = getOurCommitName();
CherryPickCommand pickCommand = git.cherryPick()
.include(commitToPick)
.setOurCommitName(ourCommitName)
内容来源于网络,如有侵权,请联系作者删除!