Package org.eclipse.jgit.api
Class ResetCommand
A class used to execute a
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())- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Collection<String>private booleanprivate ResetCommand.ResetTypeprivate ProgressMonitorprivate StringFields inherited from class org.eclipse.jgit.api.GitCommand
repo -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRepository relative path of file or directory to resetcall()private voidcheckoutIndex(ObjectId commitTree) disableRefLog(boolean disable) Whether to disable reflogprivate StringbooleanWhether reflog is disabledprivate RevCommitparseCommit(ObjectId commitId) private voidprivate voidresetIndex(ObjectId commitTree) private voidresetIndexForPaths(ObjectId commitTree) private voidprivate voidprivate ObjectIdSet the reset modesetProgressMonitor(ProgressMonitor monitor) The progress monitor associated with the reset operation.Set the name of theRefto reset totoString()Methods inherited from class org.eclipse.jgit.api.GitCommand
checkCallable, getRepository, setCallable
-
Field Details
-
ref
-
mode
-
filepaths
-
isReflogDisabled
private boolean isReflogDisabled -
monitor
-
-
Constructor Details
-
ResetCommand
Constructor for ResetCommand.
- Parameters:
repo- theRepository
-
-
Method Details
-
call
Execute the command
Executes the
Resetcommand. 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:
callin interfaceCallable<Ref>- Specified by:
callin classGitCommand<Ref>- Throws:
GitAPIExceptionCheckoutConflictException
-
parseCommit
-
resolveRefToCommitId
-
setRef
Set the name of theRefto reset to- Parameters:
ref- the ref to reset to, defaults to HEAD if not specified- Returns:
- this instance
-
setMode
Set the reset mode- Parameters:
mode- the mode of the reset command- Returns:
- this instance
-
addPath
Repository relative path of file or directory to reset- Parameters:
path- repository-relative path of file/directory to reset (with/as separator)- Returns:
- this instance
-
disableRefLog
Whether to disable reflog- Parameters:
disable- iftruedisables writing a reflog entry for this reset command- Returns:
- this instance
- Since:
- 4.5
-
isReflogDisabled
public boolean isReflogDisabled()Whether reflog is disabled- Returns:
trueif writing reflog is disabled for this reset command- Since:
- 4.5
-
getRefOrHEAD
-
setProgressMonitor
The progress monitor associated with the reset operation. By default, this is set toNullProgressMonitor- Parameters:
monitor- aProgressMonitor- Returns:
this- Since:
- 4.11
- See Also:
-
resetIndexForPaths
-
resetIndex
- Throws:
IOException
-
checkoutIndex
- Throws:
IOExceptionGitAPIException
-
resetMerge
- Throws:
IOException
-
resetCherryPick
- Throws:
IOException
-
resetRevert
- Throws:
IOException
-
toString
-