Class: Mutant::Repository::Diff Private

Inherits:
Object
  • Object
show all
Includes:
Unparser::Adamantium
Defined in:
lib/mutant/repository/diff.rb,
lib/mutant/repository/diff/ranges.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Diff index between HEAD and a tree reference

Defined Under Namespace

Modules: Ranges Classes: Error, Path

Constant Summary collapse

FORMAT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

/\A:\d{6} \d{6} [a-f\d]{40} [a-f\d]{40} [ACDMRTUX]\t(.*)\n\z/

Instance Method Summary collapse

Instance Method Details

#touches?(path, line_range) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Test if diff changes file at line range

Parameters:

  • path (Pathname)
  • line_range (Range<Integer>)

Returns:

  • (Boolean)

Raises:

  • (RepositoryError)

    when git command failed



24
25
26
27
# File 'lib/mutant/repository/diff.rb', line 24

def touches?(path, line_range)
  touched_path(path) { return false }
    .touches?(line_range)
end

#touches_path?(path) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


29
30
31
32
33
# File 'lib/mutant/repository/diff.rb', line 29

def touches_path?(path)
  touched_path(path) { return false }

  true
end