Class SubmoduleSyncCommand

  • All Implemented Interfaces:
    java.util.concurrent.Callable<java.util.Map<java.lang.String,​java.lang.String>>

    public class SubmoduleSyncCommand
    extends GitCommand<java.util.Map<java.lang.String,​java.lang.String>>
    A class used to execute a submodule sync command. This will set the remote URL in a submodule's repository to the current value in the .gitmodules file.
    See Also:
    Git documentation about submodules
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Collection<java.lang.String> paths  
    • Field Detail

      • paths

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

      • SubmoduleSyncCommand

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

      • addPath

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

        protected java.lang.String getHeadBranch​(Repository subRepo)
                                          throws java.io.IOException
        Get branch that HEAD currently points to
        Parameters:
        subRepo - a Repository object.
        Returns:
        shortened branch name, null on failures
        Throws:
        java.io.IOException
      • call

        public java.util.Map<java.lang.String,​java.lang.String> call()
                                                                    throws GitAPIException

        Execute the command

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