Class: PreCommit::MergeConflictCheck

Inherits:
Object
  • Object
show all
Defined in:
lib/pre-commit/checks/merge_conflict_check.rb

Class Method Summary collapse

Class Method Details

.call(staged_files) ⇒ Object



3
4
5
6
7
8
# File 'lib/pre-commit/checks/merge_conflict_check.rb', line 3

def self.call(staged_files)
  return if staged_files.empty?
  errors = `#{Utils.grep} '<<<<<<<' #{staged_files.join(" ")}`.strip
  return unless $?.success?
  "detected a merge conflict\n#{errors}"
end