org.eclipse.jgit.api
Class RevertCommand
java.lang.Object
org.eclipse.jgit.api.GitCommand<RevCommit>
org.eclipse.jgit.api.RevertCommand
- All Implemented Interfaces:
- Callable<RevCommit>
public class RevertCommand
- extends GitCommand<RevCommit>
A class used to execute a revert
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:
- Git documentation about revert
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RevertCommand
protected RevertCommand(Repository repo)
- Parameters:
repo
-
call
public RevCommit call()
throws GitAPIException
- Executes the
revert
command with all the options and parameters
collected by the setter methods (e.g. include(Ref)
of this
class. Each instance of this class should only be used for one invocation
of the command. Don't call this method twice on an instance.
- Returns:
- on success the
RevCommit
pointed to by the new HEAD is
returned. If a failure occurred during revert null
is returned. The list of successfully reverted Ref
's can
be obtained by calling getRevertedRefs()
- Throws:
GitAPIException
include
public RevertCommand include(Ref commit)
- Parameters:
commit
- a reference to a commit which is reverted into the current
head
- Returns:
this
include
public RevertCommand include(AnyObjectId commit)
- Parameters:
commit
- the Id of a commit which is reverted into the current head
- Returns:
this
include
public RevertCommand include(String name,
AnyObjectId commit)
- Parameters:
name
- a name given to the commitcommit
- the Id of a commit which is reverted into the current head
- Returns:
this
getRevertedRefs
public List<Ref> getRevertedRefs()
- Returns:
- the list of successfully reverted
Ref
's. Never
null
but maybe an empty list if no commit was
successfully cherry-picked
Copyright © 2011. All Rights Reserved.