Class SubmoduleAddCommand

    • Constructor Detail

      • SubmoduleAddCommand

        public SubmoduleAddCommand​(Repository repo)
        Constructor for SubmoduleAddCommand.
        Parameters:
        repo - a Repository object.
    • Method Detail

      • setName

        public SubmoduleAddCommand setName​(String name)
        Set the submodule name
        Parameters:
        name -
        Returns:
        this command
        Since:
        5.1
      • setPath

        public SubmoduleAddCommand setPath​(String path)
        Set repository-relative path of submodule
        Parameters:
        path - (with / as separator)
        Returns:
        this command
      • submoduleExists

        protected boolean submoduleExists()
                                   throws IOException
        Is the configured already a submodule in the index?
        Returns:
        true if submodule exists in index, false otherwise
        Throws:
        IOException
      • call

        public Repository call()
                        throws GitAPIException

        Execute the command

        Executes the SubmoduleAddCommand The Repository instance returned by this command needs to be closed by the caller to free resources held by the Repository instance. It is recommended to call this method as soon as you don't need a reference to this Repository instance anymore.

        Specified by:
        call in interface Callable<Repository>
        Specified by:
        call in class GitCommand<Repository>
        Throws:
        GitAPIException