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) |
Modifier and Type | Method and Description |
---|---|
CherryPickResult |
call()
Executes the
Cherry-Pick command with all the options and
parameters collected by the setter methods (e.g. |
CherryPickCommand |
include(AnyObjectId commit) |
CherryPickCommand |
include(Ref commit) |
CherryPickCommand |
include(String name,
AnyObjectId commit) |
CherryPickCommand |
setMainlineParentNumber(int mainlineParentNumber) |
CherryPickCommand |
setNoCommit(boolean noCommit)
Allows cherry-picking changes without committing them.
|
CherryPickCommand |
setOurCommitName(String ourCommitName) |
CherryPickCommand |
setReflogPrefix(String prefix)
Set the prefix to use in the reflog.
|
CherryPickCommand |
setStrategy(MergeStrategy strategy) |
checkCallable, getRepository, setCallable
protected CherryPickCommand(Repository repo)
repo
- public CherryPickResult call() throws GitAPIException, NoMessageException, UnmergedPathsException, ConcurrentRefUpdateException, WrongRepositoryStateException, NoHeadException
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>
GitAPIException
WrongRepositoryStateException
ConcurrentRefUpdateException
UnmergedPathsException
NoMessageException
NoHeadException
public CherryPickCommand include(Ref commit)
commit
- a reference to a commit which is cherry-picked to the current
headthis
public CherryPickCommand include(AnyObjectId commit)
commit
- the Id of a commit which is cherry-picked to the current headthis
public 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 headthis
public CherryPickCommand setOurCommitName(String ourCommitName)
ourCommitName
- the name that should be used in the "OURS" place for conflict
markersthis
public CherryPickCommand setReflogPrefix(String prefix)
This is primarily needed for implementing rebase in terms of cherry-picking
prefix
- including ":"this
public CherryPickCommand setStrategy(MergeStrategy strategy)
strategy
- The merge strategy to use during this Cherry-pick.this
public CherryPickCommand setMainlineParentNumber(int mainlineParentNumber)
mainlineParentNumber
- the (1-based) parent number to diff against. This allows
cherry-picking of merges.this
public 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)this
Copyright © 2014. All rights reserved.