org.eclipse.jgit.api
Class CherryPickCommand
java.lang.Object
org.eclipse.jgit.api.GitCommand<CherryPickResult>
org.eclipse.jgit.api.CherryPickCommand
- All Implemented Interfaces:
- Callable<CherryPickResult>
public class CherryPickCommand
- extends GitCommand<CherryPickResult>
A class used to execute a 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()
)
- See Also:
- Git documentation about cherry-pick
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CherryPickCommand
protected CherryPickCommand(Repository repo)
- Parameters:
repo
-
call
public CherryPickResult call()
throws GitAPIException,
NoMessageException,
UnmergedPathsException,
ConcurrentRefUpdateException,
WrongRepositoryStateException,
NoHeadException
- 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.
- Specified by:
call
in interface Callable<CherryPickResult>
- Specified by:
call
in class GitCommand<CherryPickResult>
- Returns:
- the result of the cherry-pick
- Throws:
GitAPIException
WrongRepositoryStateException
ConcurrentRefUpdateException
UnmergedPathsException
NoMessageException
NoHeadException
include
public CherryPickCommand include(Ref commit)
- Parameters:
commit
- a reference to a commit which is cherry-picked to the current
head
- Returns:
this
include
public CherryPickCommand include(AnyObjectId commit)
- Parameters:
commit
- the Id of a commit which is cherry-picked to the current head
- Returns:
this
include
public CherryPickCommand include(String name,
AnyObjectId commit)
- Parameters:
name
- a name given to the commitcommit
- the Id of a commit which is cherry-picked to the current head
- Returns:
this
setOurCommitName
public CherryPickCommand setOurCommitName(String ourCommitName)
- Parameters:
ourCommitName
- the name that should be used in the "OURS" place for conflict
markers
- Returns:
this
Copyright © 2012. All Rights Reserved.