Class FilteredRenameDetector


  • public class FilteredRenameDetector
    extends Object
    Provides rename detection in special cases such as blame, where only a subset of the renames detected by RenameDetector is of interest.
    • Constructor Detail

      • FilteredRenameDetector

        public FilteredRenameDetector​(Repository repository)
        Parameters:
        repository - The repository in which to check for renames.
      • FilteredRenameDetector

        public FilteredRenameDetector​(RenameDetector renameDetector)
        Parameters:
        renameDetector - The RenameDetector to use when checking for renames.
    • Method Detail

      • compute

        public List<DiffEntry> compute​(List<DiffEntry> diffs,
                                       PathFilter pathFilter)
                                throws IOException
        Parameters:
        diffs - The set of changes to check.
        pathFilter - Filter out changes that didn't affect this path.
        Returns:
        The subset of changes that affect only the filtered path.
        Throws:
        IOException
      • compute

        public List<DiffEntry> compute​(List<DiffEntry> changes,
                                       List<PathFilter> pathFilters)
                                throws IOException
        Tries to avoid computation overhead in RenameDetector.compute() by filtering diffs related to the path filters only.

        Note: current implementation only optimizes added or removed diffs, further optimization is possible.

        Parameters:
        changes - The set of changes to check.
        pathFilters - Filter out changes that didn't affect these paths.
        Returns:
        The subset of changes that affect only the filtered paths.
        Throws:
        IOException
        See Also:
        RenameDetector.compute()