Class SubmoduleInitCommand

  • All Implemented Interfaces:
    java.util.concurrent.Callable<java.util.Collection<java.lang.String>>

    public class SubmoduleInitCommand
    extends GitCommand<java.util.Collection<java.lang.String>>
    A class used to execute a submodule init command. This will copy the 'url' and 'update' fields from the working tree .gitmodules file to a repository's config file for each submodule not currently present in the repository's config file.
    See Also:
    Git documentation about submodules
    • Field Detail

      • paths

        private final java.util.Collection<java.lang.String> paths
    • Constructor Detail

      • SubmoduleInitCommand

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

      • addPath

        public SubmoduleInitCommand addPath​(java.lang.String path)
        Add repository-relative submodule path to initialize
        Parameters:
        path - (with / as separator)
        Returns:
        this command
      • call

        public java.util.Collection<java.lang.String> call()
                                                    throws GitAPIException

        Execute the command

        Specified by:
        call in interface java.util.concurrent.Callable<java.util.Collection<java.lang.String>>
        Specified by:
        call in class GitCommand<java.util.Collection<java.lang.String>>
        Throws:
        GitAPIException