Class SubmoduleDeinitCommand

    • Field Detail

      • paths

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

        private boolean force
    • Constructor Detail

      • SubmoduleDeinitCommand

        public SubmoduleDeinitCommand​(Repository repo)
        Constructor of SubmoduleDeinitCommand
        Parameters:
        repo -
    • Method Detail

      • deinit

        private void deinit​(java.lang.String path)
                     throws java.io.IOException
        Recursively delete the *contents* of path, but leave path as an empty directory
        Parameters:
        path - the path to clean
        Throws:
        java.io.IOException
      • checkDirty

        private SubmoduleDeinitCommand.SubmoduleDeinitStatus checkDirty​(RevWalk revWalk,
                                                                        java.lang.String path)
                                                                 throws GitAPIException,
                                                                        java.io.IOException
        Check if a submodule is dirty. A submodule is dirty if there are local changes to the submodule relative to its HEAD, including untracked files. It is also dirty if the HEAD of the submodule does not match the value in the parent repo's index or HEAD.
        Parameters:
        revWalk -
        path -
        Returns:
        status of the command
        Throws:
        GitAPIException
        java.io.IOException
      • submoduleExists

        private boolean submoduleExists​(java.lang.String path)
                                 throws java.io.IOException
        Check if this path is a submodule by checking the index, which is what git submodule deinit checks.
        Parameters:
        path - path of the submodule
        Returns:
        true if path exists and is a submodule in index, false otherwise
        Throws:
        java.io.IOException
      • addPath

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

        public SubmoduleDeinitCommand setForce​(boolean force)
        If true, call() will deinitialize modules with local changes; else it will refuse to do so.
        Parameters:
        force -
        Returns:
        this