org.eclipse.jgit.api
Class StashApplyCommand

java.lang.Object
  extended by org.eclipse.jgit.api.GitCommand<ObjectId>
      extended by org.eclipse.jgit.api.StashApplyCommand
All Implemented Interfaces:
Callable<ObjectId>

public class StashApplyCommand
extends GitCommand<ObjectId>

Command class to apply a stashed commit.

Since:
2.0
See Also:
Git documentation about Stash

Field Summary
 
Fields inherited from class org.eclipse.jgit.api.GitCommand
repo
 
Constructor Summary
StashApplyCommand(Repository repo)
          Create command to apply the changes of a stashed commit
 
Method Summary
 ObjectId call()
          Apply the changes in a stashed commit to the working directory and index
 StashApplyCommand setStashRef(String stashRef)
          Set the stash reference to apply
 
Methods inherited from class org.eclipse.jgit.api.GitCommand
checkCallable, getRepository, setCallable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StashApplyCommand

public StashApplyCommand(Repository repo)
Create command to apply the changes of a stashed commit

Parameters:
repo -
Method Detail

setStashRef

public StashApplyCommand setStashRef(String stashRef)
Set the stash reference to apply

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

Parameters:
stashRef -
Returns:
this

call

public ObjectId call()
              throws GitAPIException,
                     WrongRepositoryStateException
Apply the changes in a stashed commit to the working directory and index

Specified by:
call in interface Callable<ObjectId>
Specified by:
call in class GitCommand<ObjectId>
Returns:
id of stashed commit that was applied
Throws:
GitAPIException
WrongRepositoryStateException


Copyright © 2012. All Rights Reserved.