lib/mutest/repository.rb
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)

        raise RepositoryError, "Command #{command} failed!" unless status.success?

        !stdout.empty?
      end
# Test if diff changes file at line range
#
# @param [Pathname] path
# @param [Range<Integer>] line_range
#
# @return [Boolean]
#
# @raise [RepositoryError]
#   when git command failed
Test if diff changes file at line range
Test if diff changes file at line range
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)
        raise RepositoryError, "Command #{command} failed!" unless status.success?
        !stdout.empty?
      end
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 ) raise RepositoryError , "Command #{command} failed!" unless status . success? ! stdout . empty? end
Test if diff changes file at line range
Test if diff changes file at line range
None
Boolean
[RepositoryError] when git command failed
[ RepositoryError ] when git command failed
path
line_range
None