class Overcommit::HookContext::PrePush
Contains helpers related to contextual information used by pre-push hooks.
Constants
- PushedRef
Attributes
Public Instance Methods
Source
# File lib/overcommit/hook_context/pre_push.rb, line 31 def modified_files @modified_files ||= pushed_refs.map(&:modified_files).flatten.uniq end
Source
# File lib/overcommit/hook_context/pre_push.rb, line 35 def modified_lines_in_file(file) @modified_lines ||= {} @modified_lines[file] = pushed_refs.each_with_object(Set.new) do |pushed_ref, set| set.merge(pushed_ref.modified_lines_in_file(file)) end end
Source
# File lib/overcommit/hook_context/pre_push.rb, line 25 def pushed_refs input_lines.map do |line| PushedRef.new(*line.split(' ')) end end
Source
# File lib/overcommit/hook_context/pre_push.rb, line 8 def remote_name @args[0] end
Source
# File lib/overcommit/hook_context/pre_push.rb, line 16 def remote_ref_deletion? return @remote_ref_deletion if defined?(@remote_ref_deletion) @remote_ref_deletion ||= input_lines. first&. split(' ')&. first == '(deleted)' end
Source
# File lib/overcommit/hook_context/pre_push.rb, line 12 def remote_url @args[1] end