diff --git a/pre_commit_hooks/check_merge_conflict.py b/pre_commit_hooks/check_merge_conflict.py index c20a8af7..3921a37d 100644 --- a/pre_commit_hooks/check_merge_conflict.py +++ b/pre_commit_hooks/check_merge_conflict.py @@ -8,6 +8,8 @@ b'<<<<<<< ', b'======= ', b'=======\n', + b'||||||| ', + b'|||||||\n', b'>>>>>>> ', ] diff --git a/tests/check_merge_conflict_test.py b/tests/check_merge_conflict_test.py index fccf41ff..ae6149dd 100644 --- a/tests/check_merge_conflict_test.py +++ b/tests/check_merge_conflict_test.py @@ -129,8 +129,32 @@ def test_does_not_care_when_not_in_a_merge(tmpdir): f.write_binary(b'problem\n=======\n') assert main([str(f.realpath())]) == 0 + f = tmpdir.join('README.md') + f.write_binary(b'problem\n======= \n') + assert main([str(f.realpath())]) == 0 + + f = tmpdir.join('README.md') + f.write_binary(b'problem\n|||||||\n') + assert main([str(f.realpath()), '--assume-in-merge']) == 0 + + f = tmpdir.join('README.md') + f.write_binary(b'problem\n||||||| \n') + assert main([str(f.realpath()), '--assume-in-merge']) == 0 + def test_care_when_assumed_merge(tmpdir): f = tmpdir.join('README.md') f.write_binary(b'problem\n=======\n') assert main([str(f.realpath()), '--assume-in-merge']) == 1 + + f = tmpdir.join('README.md') + f.write_binary(b'problem\n======= \n') + assert main([str(f.realpath()), '--assume-in-merge']) == 1 + + f = tmpdir.join('README.md') + f.write_binary(b'problem\n|||||||\n') + assert main([str(f.realpath()), '--assume-in-merge']) == 1 + + f = tmpdir.join('README.md') + f.write_binary(b'problem\n||||||| \n') + assert main([str(f.realpath()), '--assume-in-merge']) == 1