public class CherryPickCommand extends GitCommand<CherryPickResult>
cherry-pick command. It has setters for all
supported options and arguments of this command and a call() method
to finally execute the command. Each instance of this class should only be
used for one invocation of the command (means: one call to call())repo| Modifier | Constructor and Description |
|---|---|
protected |
CherryPickCommand(Repository repo)
Constructor for CherryPickCommand
|
| Modifier and Type | Method and Description |
|---|---|
CherryPickResult |
call() |
CherryPickCommand |
include(AnyObjectId commit)
Include a commit
|
CherryPickCommand |
include(Ref commit)
Include a reference to a commit
|
CherryPickCommand |
include(String name,
AnyObjectId commit)
Include a commit
|
CherryPickCommand |
setMainlineParentNumber(int mainlineParentNumber)
Set the (1-based) parent number to diff against
|
CherryPickCommand |
setNoCommit(boolean noCommit)
Allows cherry-picking changes without committing them.
|
CherryPickCommand |
setOurCommitName(String ourCommitName)
Set the name that should be used in the "OURS" place for conflict markers
|
CherryPickCommand |
setProgressMonitor(ProgressMonitor monitor)
The progress monitor associated with the cherry-pick operation.
|
CherryPickCommand |
setReflogPrefix(String prefix)
Set the prefix to use in the reflog.
|
CherryPickCommand |
setStrategy(MergeStrategy strategy)
Set the
MergeStrategy |
String |
toString() |
checkCallable, getRepository, setCallableprotected CherryPickCommand(Repository repo)
repo - the Repositorypublic CherryPickResult call() throws GitAPIException, NoMessageException, UnmergedPathsException, ConcurrentRefUpdateException, WrongRepositoryStateException, NoHeadException
Execute the command
Executes the Cherry-Pick command with all the options and
parameters collected by the setter methods (e.g. include(Ref) of
this class. Each instance of this class should only be used for one
invocation of the command. Don't call this method twice on an instance.
call in interface Callable<CherryPickResult>call in class GitCommand<CherryPickResult>GitAPIExceptionNoMessageExceptionUnmergedPathsExceptionConcurrentRefUpdateExceptionWrongRepositoryStateExceptionNoHeadExceptionpublic CherryPickCommand include(Ref commit)
commit - a reference to a commit which is cherry-picked to the current
headthispublic CherryPickCommand include(AnyObjectId commit)
commit - the Id of a commit which is cherry-picked to the current headthispublic CherryPickCommand include(String name, AnyObjectId commit)
name - a name given to the commitcommit - the Id of a commit which is cherry-picked to the current headthispublic CherryPickCommand setOurCommitName(String ourCommitName)
ourCommitName - the name that should be used in the "OURS" place for conflict
markersthispublic CherryPickCommand setReflogPrefix(String prefix)
This is primarily needed for implementing rebase in terms of cherry-picking
prefix - including ":"thispublic CherryPickCommand setStrategy(MergeStrategy strategy)
MergeStrategystrategy - The merge strategy to use during this Cherry-pick.thispublic CherryPickCommand setMainlineParentNumber(int mainlineParentNumber)
mainlineParentNumber - the (1-based) parent number to diff against. This allows
cherry-picking of merges.thispublic CherryPickCommand setNoCommit(boolean noCommit)
NOTE: The behavior of cherry-pick is undefined if you pick multiple commits or if HEAD does not match the index state before cherry-picking.
noCommit - true to cherry-pick without committing, false to commit after
each pick (default)thispublic CherryPickCommand setProgressMonitor(ProgressMonitor monitor)
NullProgressMonitormonitor - a ProgressMonitorthisNullProgressMonitorCopyright © 2018 Eclipse JGit Project. All rights reserved.