CherryPickResult cherryPickResult = git.cherryPick() .include(commitToPick).setOurCommitName(ourCommitName) .setReflogPrefix(REFLOG_PREFIX).setStrategy(strategy)
@Override public void cherryPick(final Git repo, Ref commit) throws GitAPIException { repo.cherryPick().include(commit).call(); }
boolean isMerge = commitToPick.getParentCount() > 1; String ourCommitName = getOurCommitName(); CherryPickCommand pickCommand = git.cherryPick() .include(commitToPick) .setOurCommitName(ourCommitName)
/** * 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(); }
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); }
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; } }
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; } }
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)
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)
RevCommit userChange = it.previous(); String prefix = String.format("%0" + prefixSize + "d-%s", count++, userChange.getName()); CherryPickResult result = fork.cherryPick() .include(userChange) .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 cpr = fork.cherryPick() .include(userChange.getId()) .setNoCommit(true)
CherryPickResult cpr = fork.cherryPick() .include(userChange.getId()) .setNoCommit(true)
CherryPickResult cherryPickResult = git.cherryPick() .include(commitToPick).setOurCommitName(ourCommitName) .setReflogPrefix(REFLOG_PREFIX).setStrategy(strategy)
CherryPickResult cherryPickResult = git.cherryPick() .include(commitToPick).setOurCommitName(ourCommitName) .setReflogPrefix(REFLOG_PREFIX).setStrategy(strategy)
boolean isMerge = commitToPick.getParentCount() > 1; String ourCommitName = getOurCommitName(); CherryPickCommand pickCommand = git.cherryPick() .include(commitToPick) .setOurCommitName(ourCommitName)
boolean isMerge = commitToPick.getParentCount() > 1; String ourCommitName = getOurCommitName(); CherryPickCommand pickCommand = git.cherryPick() .include(commitToPick) .setOurCommitName(ourCommitName)