org.eclipse.jgit.api
Class CherryPickCommand

java.lang.Object
  extended by org.eclipse.jgit.api.GitCommand<CherryPickResult>
      extended by 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

Field Summary
 
Fields inherited from class org.eclipse.jgit.api.GitCommand
repo
 
Constructor Summary
protected CherryPickCommand(Repository repo)
           
 
Method Summary
 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 setOurCommitName(String ourCommitName)
           
 
Methods inherited from class org.eclipse.jgit.api.GitCommand
checkCallable, getRepository, setCallable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CherryPickCommand

protected CherryPickCommand(Repository repo)
Parameters:
repo -
Method Detail

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 commit
commit - 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 © 2013. All Rights Reserved.