mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-03-29 10:16:52 +00:00
Add diff3 conflictstyle support for git merge conflicts.
This commit is contained in:
parent
6f2b0a27e5
commit
c92b46587d
1 changed files with 10 additions and 1 deletions
|
|
@ -37,12 +37,21 @@ def f1_is_a_conflict_file(in_tmpdir):
|
|||
cmd_output('git', 'commit', '-am', 'clone commit2')
|
||||
cmd_output('git', 'pull', retcode=None)
|
||||
# We should end up in a merge conflict!
|
||||
assert io.open('f1').read().startswith(
|
||||
f1 = io.open('f1').read()
|
||||
assert f1.startswith(
|
||||
'<<<<<<< HEAD\n'
|
||||
'child\n'
|
||||
'=======\n'
|
||||
'parent\n'
|
||||
'>>>>>>>'
|
||||
) or f1.startswith(
|
||||
'<<<<<<< HEAD\n'
|
||||
'child\n'
|
||||
# diff3 conflict style git merges add this line:
|
||||
'||||||| merged common ancestors\n'
|
||||
'=======\n'
|
||||
'parent\n'
|
||||
'>>>>>>>'
|
||||
)
|
||||
assert os.path.exists(os.path.join('.git', 'MERGE_MSG'))
|
||||
yield
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue