Class GitCommand<T>

    • Field Detail

      • repo

        protected final Repository repo
        The repository this command is working with
    • Constructor Detail

      • GitCommand

        protected GitCommand​(Repository repo)
        Creates a new command which interacts with a single repository
        Parameters:
        repo - the Repository this command should interact with
    • Method Detail

      • getRepository

        public Repository getRepository()
        Returns:
        the Repository this command is interacting with
      • setCallable

        protected void setCallable​(boolean callable)
        Set's the state which tells whether it is allowed to call call() on this instance. checkCallable() will throw an exception when called and this property is set to false
        Parameters:
        callable - if true it is allowed to call call() on this instance.
      • call

        public abstract T call()
                        throws GitAPIException
        Executes the command
        Specified by:
        call in interface Callable<T>
        Returns:
        T a result. Each command has its own return type
        Throws:
        GitAPIException - or subclass thereof when an error occurs