Sha256: 768b0a308bdc64d2b78c3107f9b1e2efd11241639df64fa8c866f0598a69d11f

Contents?: true

Size: 338 Bytes

Versions: 8

Compression:

Stored size: 338 Bytes

Contents

module Overcommit::Hook::PreCommit
  # Checks for unresolved merge conflicts
  class MergeConflicts < Base
    def run
      result = execute(%w[grep -IHn ^<<<<<<<\s] + applicable_files)

      unless result.stdout.empty?
        return :fail, "Merge conflict markers detected:\n#{result.stdout}"
      end

      :pass
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
jawshooah-overcommit-0.22.0 lib/overcommit/hook/pre_commit/merge_conflicts.rb
overcommit-0.21.0 lib/overcommit/hook/pre_commit/merge_conflicts.rb
overcommit-0.20.0 lib/overcommit/hook/pre_commit/merge_conflicts.rb
overcommit-0.19.0 lib/overcommit/hook/pre_commit/merge_conflicts.rb
overcommit-0.18.0 lib/overcommit/hook/pre_commit/merge_conflicts.rb
overcommit-0.17.0 lib/overcommit/hook/pre_commit/merge_conflicts.rb
overcommit-0.16.0 lib/overcommit/hook/pre_commit/merge_conflicts.rb
overcommit-0.15.0 lib/overcommit/hook/pre_commit/merge_conflicts.rb