Class FilteredRenameDetector

java.lang.Object
org.eclipse.jgit.internal.diff.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 Details

    • 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 Details

    • compute

      public List<DiffEntry> compute(List<DiffEntry> diffs, PathFilter pathFilter) throws IOException
      Compute diff entries
      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 - if an IO error occurred
    • 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 - if an IO error occurred
      See Also: