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

Function prepare_commit_msg_repo

tests/conftest.py:119–143  ·  view source on GitHub ↗
(tempdir_factory)

Source from the content-addressed store, hash-verified

117
118@pytest.fixture
119def prepare_commit_msg_repo(tempdir_factory):
120 path = git_dir(tempdir_factory)
121 script_name = 'add_sign_off.sh'
122 config = {
123 'repo': 'local',
124 'hooks': [{
125 'id': 'add-signoff',
126 'name': 'Add "Signed off by:"',
127 'entry': f'./{script_name}',
128 'language': 'script',
129 'stages': ['prepare-commit-msg'],
130 }],
131 }
132 write_config(path, config)
133 with cwd(path):
134 with open(script_name, 'w') as script_file:
135 script_file.write(
136 '#!/usr/bin/env bash\n'
137 'set -eu\n'
138 'echo "\nSigned off by: " >> "$1"\n',
139 )
140 make_executable(script_name)
141 cmd_output('git', 'add', '.')
142 git_commit(msg=prepare_commit_msg_repo.__name__)
143 yield path
144
145
146@pytest.fixture

Callers

nothing calls this directly

Calls 6

git_dirFunction · 0.90
write_configFunction · 0.90
cwdFunction · 0.90
make_executableFunction · 0.90
cmd_outputFunction · 0.90
git_commitFunction · 0.90

Tested by

no test coverage detected