Package org.eclipse.jgit.api
Class StashDropCommand
Command class to delete a stashed commit reference
Currently only supported on a traditional file repository using one-file-per-ref reflogs.
- Since:
- 2.0
- See Also:
-
Field Summary
FieldsFields inherited from class org.eclipse.jgit.api.GitCommand
repo
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall()
private RefUpdate
createRefUpdate
(Ref stashRef) private void
private Ref
getRef()
setAll
(boolean all) Set whether to drop all stashed commitssetStashRef
(int stashRef) Set the stash reference to drop (0-based).private void
Methods inherited from class org.eclipse.jgit.api.GitCommand
checkCallable, getRepository, setCallable
-
Field Details
-
stashRefEntry
private int stashRefEntry -
all
private boolean all
-
-
Constructor Details
-
StashDropCommand
Constructor for StashDropCommand.- Parameters:
repo
- aRepository
object.
-
-
Method Details
-
setStashRef
Set the stash reference to drop (0-based).This will default to drop the latest stashed commit (stash@{0}) if unspecified
- Parameters:
stashRef
- the 0-based index of the stash reference- Returns:
this
-
setAll
Set whether to drop all stashed commits- Parameters:
all
-true
to drop all stashed commits,false
to drop only the stashed commit set via callingsetStashRef(int)
- Returns:
this
-
getRef
- Throws:
GitAPIException
-
createRefUpdate
- Throws:
IOException
-
deleteRef
-
updateRef
-
call
Execute the command
Drop the configured entry from the stash reflog and return value of the stash reference after the drop occurs
- Specified by:
call
in interfaceCallable<ObjectId>
- Specified by:
call
in classGitCommand<ObjectId>
- Throws:
GitAPIException
-