Class LsRemoteCommand

    • Constructor Detail

      • LsRemoteCommand

        public LsRemoteCommand​(Repository repo)
        Parameters:
        repo - local repository or null for operation without local repository
    • Method Detail

      • 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 LsRemoteCommand setHeads​(boolean heads)
        Include refs/heads in references results
        Parameters:
        heads -
        Returns:
        this
      • setTags

        public LsRemoteCommand setTags​(boolean tags)
        Include refs/tags in references results
        Parameters:
        tags -
        Returns:
        this
      • setUploadPack

        public LsRemoteCommand setUploadPack​(java.lang.String uploadPack)
        The full path of git-upload-pack on the remote host
        Parameters:
        uploadPack -
        Returns:
        this
      • call

        public java.util.Collection<Ref> call()
                                       throws GitAPIException,
                                              InvalidRemoteException,
                                              TransportException
        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.
        Specified by:
        call in interface java.util.concurrent.Callable<java.util.Collection<Ref>>
        Specified by:
        call in class GitCommand<java.util.Collection<Ref>>
        Returns:
        a collection of references in the remote repository
        Throws:
        GitAPIException - or subclass thereof when an error occurs
        InvalidRemoteException - when called with an invalid remote uri
        TransportException - for errors that occurs during transport