Class: Mutest::Repository::Diff Private
- Inherits:
-
Object
- Object
- Mutest::Repository::Diff
- Includes:
- Adamantium
- Defined in:
- lib/mutest/repository.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 between two objects in repository
Constant Summary collapse
- HEAD =
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.
'HEAD'.freeze
Instance Method Summary collapse
-
#touches?(path, line_range) ⇒ Boolean
private
Test if diff changes file at line range.
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
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/mutest/repository.rb', line 35 def touches?(path, line_range) return false unless within_working_directory?(path) && tracks?(path) command = %W[ git log #{from}...#{to} -L #{line_range.begin},#{line_range.end}:#{path} ] stdout, status = config.open3.capture2(*command, binmode: true) fail RepositoryError, "Command #{command} failed!" unless status.success? !stdout.empty? end |