org.eclipse.jgit.api
Class LsRemoteCommand
java.lang.Object
org.eclipse.jgit.api.GitCommand<T>
org.eclipse.jgit.api.TransportCommand<LsRemoteCommand,java.util.Collection<Ref>>
org.eclipse.jgit.api.LsRemoteCommand
- All Implemented Interfaces:
- java.util.concurrent.Callable<java.util.Collection<Ref>>
public class LsRemoteCommand
- extends TransportCommand<LsRemoteCommand,java.util.Collection<Ref>>
The ls-remote command
- See Also:
- Git documentation about ls-remote
|
Method Summary |
java.util.Collection<Ref> |
call()
Executes the LsRemote command with all the options and parameters
collected by the setter methods (e.g. |
void |
setHeads(boolean heads)
Include refs/heads in references results |
LsRemoteCommand |
setRemote(java.lang.String remote)
The remote (uri or name) used for the fetch operation. |
void |
setTags(boolean tags)
Include refs/tags in references results |
void |
setUploadPack(java.lang.String uploadPack)
The full path of git-upload-pack on the remote host |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LsRemoteCommand
public LsRemoteCommand(Repository repo)
- Parameters:
repo -
setRemote
public LsRemoteCommand setRemote(java.lang.String remote)
- The remote (uri or name) used for the fetch operation. If no remote is
set, the default value of
Constants.DEFAULT_REMOTE_NAME will
be used.
- Parameters:
remote -
- Returns:
this- See Also:
Constants.DEFAULT_REMOTE_NAME
setHeads
public void setHeads(boolean heads)
- Include refs/heads in references results
- Parameters:
heads -
setTags
public void setTags(boolean tags)
- Include refs/tags in references results
- Parameters:
tags -
setUploadPack
public void setUploadPack(java.lang.String uploadPack)
- The full path of git-upload-pack on the remote host
- Parameters:
uploadPack -
call
public java.util.Collection<Ref> call()
throws GitAPIException,
JGitInternalException
- Executes the
LsRemote command with all the options and parameters
collected by the setter methods (e.g. setHeads(boolean)) 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:
- a collection of references in the remote repository
- Throws:
InvalidRemoteException - when called with an invalid remote uri
JGitInternalException - a low-level exception of JGit has occurred. The original
exception can be retrieved by calling
Throwable.getCause().
GitAPIException
Copyright © 2012. All Rights Reserved.