org.eclipse.jgit.api
Class MergeCommand
java.lang.Object
org.eclipse.jgit.api.GitCommand<MergeResult>
org.eclipse.jgit.api.MergeCommand
- All Implemented Interfaces:
- Callable<MergeResult>
public class MergeCommand
- extends GitCommand<MergeResult>
A class used to execute a Merge 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 Merge
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MergeCommand
protected MergeCommand(Repository repo)
- Parameters:
repo -
call
public MergeResult call()
throws NoHeadException,
ConcurrentRefUpdateException,
CheckoutConflictException,
InvalidMergeHeadsException,
WrongRepositoryStateException,
NoMessageException
- Executes the
Merge 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.
- Returns:
- the result of the merge
- Throws:
NoHeadException
ConcurrentRefUpdateException
CheckoutConflictException
InvalidMergeHeadsException
WrongRepositoryStateException
NoMessageException
setStrategy
public MergeCommand setStrategy(MergeStrategy mergeStrategy)
- Parameters:
mergeStrategy - the MergeStrategy to be used
- Returns:
this
include
public MergeCommand include(Ref commit)
- Parameters:
commit - a reference to a commit which is merged with the current head
- Returns:
this
include
public MergeCommand include(AnyObjectId commit)
- Parameters:
commit - the Id of a commit which is merged with the current head
- Returns:
this
include
public MergeCommand include(String name,
AnyObjectId commit)
- Parameters:
name - a name given to the commitcommit - the Id of a commit which is merged with the current head
- Returns:
this
Copyright © 2011. All Rights Reserved.