public class ResetCommand extends GitCommand<Ref>
Reset
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 |
ResetCommand.ResetType
Kind of reset
|
repo
Constructor and Description |
---|
ResetCommand(Repository repo)
Constructor for ResetCommand.
|
Modifier and Type | Method and Description |
---|---|
ResetCommand |
addPath(String path)
Repository relative path of file or directory to reset
|
Ref |
call() |
ResetCommand |
disableRefLog(boolean disable)
Whether to disable reflog
|
boolean |
isReflogDisabled()
Whether reflog is disabled
|
ResetCommand |
setMode(ResetCommand.ResetType mode)
Set the reset mode
|
ResetCommand |
setProgressMonitor(ProgressMonitor monitor)
The progress monitor associated with the reset operation.
|
ResetCommand |
setRef(String ref)
Set the name of the
Ref to reset to |
String |
toString() |
checkCallable, getRepository, setCallable
public ResetCommand(Repository repo)
Constructor for ResetCommand.
repo
- the Repository
public Ref call() throws GitAPIException, CheckoutConflictException
Execute the command
Executes the Reset
command. 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 Callable<Ref>
call
in class GitCommand<Ref>
GitAPIException
CheckoutConflictException
public ResetCommand setRef(String ref)
Ref
to reset toref
- the ref to reset to, defaults to HEAD if not specifiedpublic ResetCommand setMode(ResetCommand.ResetType mode)
mode
- the mode of the reset commandpublic ResetCommand addPath(String path)
path
- repository-relative path of file/directory to reset (with
/
as separator)public ResetCommand disableRefLog(boolean disable)
disable
- if true
disables writing a reflog entry for this reset
commandpublic boolean isReflogDisabled()
true
if writing reflog is disabled for this reset commandpublic ResetCommand setProgressMonitor(ProgressMonitor monitor)
NullProgressMonitor
monitor
- a ProgressMonitor
this
NullProgressMonitor
Copyright © 2020 Eclipse JGit Project. All rights reserved.