org.eclipse.jgit.api
Class RebaseCommand
java.lang.Object
org.eclipse.jgit.api.GitCommand<RebaseResult>
org.eclipse.jgit.api.RebaseCommand
- All Implemented Interfaces:
- Callable<RebaseResult>
public class RebaseCommand
- extends GitCommand<RebaseResult>
A class used to execute a Rebase
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 Rebase
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
REBASE_MERGE
public static final String REBASE_MERGE
- The name of the "rebase-merge" folder
- See Also:
- Constant Field Values
STOPPED_SHA
public static final String STOPPED_SHA
- The name of the "stopped-sha" file
- See Also:
- Constant Field Values
RebaseCommand
protected RebaseCommand(Repository repo)
- Parameters:
repo
-
call
public RebaseResult call()
throws GitAPIException,
NoHeadException,
RefNotFoundException,
WrongRepositoryStateException
- Executes the
Rebase
command with all the options and parameters
collected by the setter methods 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<RebaseResult>
- Specified by:
call
in class GitCommand<RebaseResult>
- Returns:
- an object describing the result of this command
- Throws:
GitAPIException
WrongRepositoryStateException
NoHeadException
RefNotFoundException
tryFastForward
public RevCommit tryFastForward(RevCommit newCommit)
throws IOException,
GitAPIException
- checks if we can fast-forward and returns the new head if it is possible
- Parameters:
newCommit
-
- Returns:
- the new head, or null
- Throws:
IOException
GitAPIException
setUpstream
public RebaseCommand setUpstream(RevCommit upstream)
- Parameters:
upstream
- the upstream commit
- Returns:
this
setUpstream
public RebaseCommand setUpstream(AnyObjectId upstream)
- Parameters:
upstream
- id of the upstream commit
- Returns:
this
setUpstream
public RebaseCommand setUpstream(String upstream)
throws RefNotFoundException
- Parameters:
upstream
- the upstream branch
- Returns:
this
- Throws:
RefNotFoundException
setOperation
public RebaseCommand setOperation(RebaseCommand.Operation operation)
- Parameters:
operation
- the operation to perform
- Returns:
this
setProgressMonitor
public RebaseCommand setProgressMonitor(ProgressMonitor monitor)
- Parameters:
monitor
- a progress monitor
- Returns:
- this instance
Copyright © 2012. All Rights Reserved.