mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-09 12:54:17 +00:00
Merge pull request #114 from wting/wting_support_diff3_conflictstyle
Add diff3 conflictstyle support for git merge conflicts.
This commit is contained in:
commit
35548254ad
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', 'commit', '-am', 'clone commit2')
|
||||||
cmd_output('git', 'pull', retcode=None)
|
cmd_output('git', 'pull', retcode=None)
|
||||||
# We should end up in a merge conflict!
|
# We should end up in a merge conflict!
|
||||||
assert io.open('f1').read().startswith(
|
f1 = io.open('f1').read()
|
||||||
|
assert f1.startswith(
|
||||||
'<<<<<<< HEAD\n'
|
'<<<<<<< HEAD\n'
|
||||||
'child\n'
|
'child\n'
|
||||||
'=======\n'
|
'=======\n'
|
||||||
'parent\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'))
|
assert os.path.exists(os.path.join('.git', 'MERGE_MSG'))
|
||||||
yield
|
yield
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue