public class RebaseCommand extends GitCommand<RebaseResult>
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()
)
Modifier and Type | Class and Description |
---|---|
static class |
RebaseCommand.Operation
The available operations
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
REBASE_MERGE
The name of the "rebase-merge" folder
|
static java.lang.String |
STOPPED_SHA
The name of the "stopped-sha" file
|
repo
Modifier | Constructor and Description |
---|---|
protected |
RebaseCommand(Repository repo) |
Modifier and Type | Method and Description |
---|---|
RebaseResult |
call()
Executes the
Rebase command with all the options and parameters
collected by the setter methods of this class. |
RebaseCommand |
setOperation(RebaseCommand.Operation operation) |
RebaseCommand |
setProgressMonitor(ProgressMonitor monitor) |
RebaseCommand |
setUpstream(AnyObjectId upstream) |
RebaseCommand |
setUpstream(RevCommit upstream) |
RebaseCommand |
setUpstream(java.lang.String upstream) |
RevCommit |
tryFastForward(RevCommit newCommit)
checks if we can fast-forward and returns the new head if it is possible
|
checkCallable, getRepository, setCallable
public static final java.lang.String REBASE_MERGE
public static final java.lang.String STOPPED_SHA
protected RebaseCommand(Repository repo)
repo
- public RebaseResult call() throws GitAPIException, NoHeadException, RefNotFoundException, WrongRepositoryStateException
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.call
in interface java.util.concurrent.Callable<RebaseResult>
call
in class GitCommand<RebaseResult>
GitAPIException
WrongRepositoryStateException
NoHeadException
RefNotFoundException
public RevCommit tryFastForward(RevCommit newCommit) throws java.io.IOException, GitAPIException
newCommit
- java.io.IOException
GitAPIException
public RebaseCommand setUpstream(RevCommit upstream)
upstream
- the upstream committhis
public RebaseCommand setUpstream(AnyObjectId upstream)
upstream
- id of the upstream committhis
public RebaseCommand setUpstream(java.lang.String upstream) throws RefNotFoundException
upstream
- the upstream branchthis
RefNotFoundException
public RebaseCommand setOperation(RebaseCommand.Operation operation)
operation
- the operation to performthis
public RebaseCommand setProgressMonitor(ProgressMonitor monitor)
monitor
- a progress monitorCopyright © 2012. All Rights Reserved.