Class DiffCommand

    • Constructor Detail

      • DiffCommand

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

      • setCached

        public DiffCommand setCached​(boolean cached)
        Whether to view the changes staged for the next commit
        Parameters:
        cached - whether to view the changes staged for the next commit
        Returns:
        this instance
      • setPathFilter

        public DiffCommand setPathFilter​(TreeFilter pathFilter)
        Set path filter
        Parameters:
        pathFilter - parameter, used to limit the diff to the named path
        Returns:
        this instance
      • setOldTree

        public DiffCommand setOldTree​(AbstractTreeIterator oldTree)
        Set old tree
        Parameters:
        oldTree - the previous state
        Returns:
        this instance
      • setShowNameAndStatusOnly

        public DiffCommand setShowNameAndStatusOnly​(boolean showNameAndStatusOnly)
        Set whether to return only names and status of changed files
        Parameters:
        showNameAndStatusOnly - whether to return only names and status of changed files
        Returns:
        this instance
      • setOutputStream

        public DiffCommand setOutputStream​(OutputStream out)
        Set output stream
        Parameters:
        out - the stream to write line data
        Returns:
        this instance
      • setContextLines

        public DiffCommand setContextLines​(int contextLines)
        Set number of context lines instead of the usual three.
        Parameters:
        contextLines - the number of context lines
        Returns:
        this instance
      • setSourcePrefix

        public DiffCommand setSourcePrefix​(String sourcePrefix)
        Set the given source prefix instead of "a/".
        Parameters:
        sourcePrefix - the prefix
        Returns:
        this instance
      • setDestinationPrefix

        public DiffCommand setDestinationPrefix​(String destinationPrefix)
        Set the given destination prefix instead of "b/".
        Parameters:
        destinationPrefix - the prefix
        Returns:
        this instance
      • setProgressMonitor

        public DiffCommand setProgressMonitor​(ProgressMonitor monitor)
        The progress monitor associated with the diff operation. By default, this is set to NullProgressMonitor
        Parameters:
        monitor - a progress monitor
        Returns:
        this instance
        See Also:
        NullProgressMonitor