Class ApplyCommand

    • Field Detail

      • in

        private java.io.InputStream in
    • Constructor Detail

      • ApplyCommand

        ApplyCommand​(Repository repo)
        Constructs the command if the patch is to be applied to the index.
        Parameters:
        repo -
    • Method Detail

      • setPatch

        public ApplyCommand setPatch​(java.io.InputStream in)
        Set patch
        Parameters:
        in - the patch to apply
        Returns:
        this instance
      • verifyExistence

        private boolean verifyExistence​(FileHeader fh,
                                        java.io.File src,
                                        java.io.File dest,
                                        ApplyCommand.Result result)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • validGitPath

        private boolean validGitPath​(java.lang.String path)
      • canApplyAt

        private boolean canApplyAt​(java.util.List<java.lang.String> hunkLines,
                                   java.util.List<java.lang.String> newLines,
                                   int line)
      • isChanged

        private static boolean isChanged​(java.util.List<java.lang.String> ol,
                                         java.util.List<java.lang.String> nl)
      • isNoNewlineAtEndOfFile

        private boolean isNoNewlineAtEndOfFile​(FileHeader fh)