Top Description Fields Constructors Methods
org.eclipse.jgit.api

public Class StashDropCommand

extends GitCommand<ObjectId>
Class Inheritance
Static Imports
org.eclipse.jgit.lib.Constants.R_STASH

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
Git documentation about Stash

Field Summary

Modifier and TypeField and Description
private boolean
private int
Inherited from org.eclipse.jgit.api.GitCommand:
repo

Constructor Summary

AccessConstructor and Description
public
StashDropCommand(Repository repo)

Constructor for StashDropCommand.

Method Summary

Modifier and TypeMethod and Description
public ObjectId
call()

Implements abstract org.eclipse.jgit.api.GitCommand.call.

Implements java.util.concurrent.Callable.call.

Computes a result, or throws an exception if unable to do so.

private RefUpdate
createRefUpdate(Ref stashRef)

private void
deleteRef(Ref stashRef)

private Ref
public StashDropCommand

Returns:

this
setAll
(boolean
true to drop all stashed commits, false to drop only the stashed commit set via calling setStashRef(int)
all
)

Set whether to drop all stashed commits

public StashDropCommand

Returns:

this
setStashRef
(int
the 0-based index of the stash reference
stashRef
)

Set the stash reference to drop (0-based).

private void
updateRef(Ref stashRef, ObjectId newId)

Inherited from org.eclipse.jgit.api.GitCommand:
checkCallablegetRepositorysetCallable

Field Detail

allback to summary
private boolean all
stashRefEntryback to summary
private int stashRefEntry

Constructor Detail

StashDropCommandback to summary
public StashDropCommand(Repository repo)

Constructor for StashDropCommand.

Parameters
repo:Repository

a org.eclipse.jgit.lib.Repository object.

Method Detail

callback to summary
public ObjectId call() throws GitAPIException

Implements abstract org.eclipse.jgit.api.GitCommand.call.

Implements java.util.concurrent.Callable.call.

Doc from org.eclipse.jgit.api.GitCommand.call.

Computes a result, or throws an exception if unable to do so.

Execute the command

Drop the configured entry from the stash reflog and return value of the stash reference after the drop occurs

Returns:ObjectId

Doc from java.util.concurrent.Callable.call.

computed result

Annotations
@Override
createRefUpdateback to summary
private RefUpdate createRefUpdate(Ref stashRef) throws IOException
deleteRefback to summary
private void deleteRef(Ref stashRef)
getRefback to summary
private Ref getRef() throws GitAPIException
setAllback to summary
public StashDropCommand setAll(boolean all)

Set whether to drop all stashed commits

Parameters
all:boolean

true to drop all stashed commits, false to drop only the stashed commit set via calling setStashRef(int)

Returns:StashDropCommand

this

setStashRefback to summary
public StashDropCommand setStashRef(int stashRef)

Set the stash reference to drop (0-based).

This will default to drop the latest stashed commit (stash@{0}) if unspecified

Parameters
stashRef:int

the 0-based index of the stash reference

Returns:StashDropCommand

this

updateRefback to summary
private void updateRef(Ref stashRef, ObjectId newId)