public class StashDropCommand extends GitCommand<ObjectId>
Currently only supported on a traditional file repository using one-file-per-ref reflogs.
Modifier and Type | Field and Description |
---|---|
private boolean |
all |
private int |
stashRefEntry |
repo
Constructor and Description |
---|
StashDropCommand(Repository repo)
Constructor for StashDropCommand.
|
Modifier and Type | Method and Description |
---|---|
ObjectId |
call() |
private RefUpdate |
createRefUpdate(Ref stashRef) |
private void |
deleteRef(Ref stashRef) |
private Ref |
getRef() |
StashDropCommand |
setAll(boolean all)
Set whether to drop all stashed commits
|
StashDropCommand |
setStashRef(int stashRef)
Set the stash reference to drop (0-based).
|
private void |
updateRef(Ref stashRef,
ObjectId newId) |
checkCallable, getRepository, setCallable
public StashDropCommand(Repository repo)
repo
- a Repository
object.public StashDropCommand setStashRef(int stashRef)
This will default to drop the latest stashed commit (stash@{0}) if unspecified
stashRef
- the 0-based index of the stash referencethis
public StashDropCommand setAll(boolean all)
all
- true
to drop all stashed commits, false
to
drop only the stashed commit set via calling
setStashRef(int)
this
private Ref getRef() throws GitAPIException
GitAPIException
private RefUpdate createRefUpdate(Ref stashRef) throws java.io.IOException
java.io.IOException
private void deleteRef(Ref stashRef)
public ObjectId call() throws GitAPIException
Execute the command
Drop the configured entry from the stash reflog and return value of the stash reference after the drop occurs
call
in interface java.util.concurrent.Callable<ObjectId>
call
in class GitCommand<ObjectId>
GitAPIException