MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / _make_conflict

Function _make_conflict

tests/conftest.py:53–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

51
52
53def _make_conflict():
54 cmd_output('git', 'checkout', 'origin/master', '-b', 'foo')
55 with open('conflict_file', 'w') as conflict_file:
56 conflict_file.write('herp\nderp\n')
57 cmd_output('git', 'add', 'conflict_file')
58 with open('foo_only_file', 'w') as foo_only_file:
59 foo_only_file.write('foo')
60 cmd_output('git', 'add', 'foo_only_file')
61 git_commit(msg=_make_conflict.__name__)
62 cmd_output('git', 'checkout', 'origin/master', '-b', 'bar')
63 with open('conflict_file', 'w') as conflict_file:
64 conflict_file.write('harp\nddrp\n')
65 cmd_output('git', 'add', 'conflict_file')
66 with open('bar_only_file', 'w') as bar_only_file:
67 bar_only_file.write('bar')
68 cmd_output('git', 'add', 'bar_only_file')
69 git_commit(msg=_make_conflict.__name__)
70 cmd_output('git', 'merge', 'foo', check=False)
71
72
73@pytest.fixture

Callers 2

in_merge_conflictFunction · 0.85
in_conflicting_submoduleFunction · 0.85

Calls 2

cmd_outputFunction · 0.90
git_commitFunction · 0.90

Tested by

no test coverage detected