MCPcopy Create free account
hub / github.com/commitizen-tools/commitizen / commit

Function commit

commitizen/git.py:184–204  ·  view source on GitHub ↗
(
    message: str,
    args: Sequence[str] = (),
    committer_date: str | None = None,
)

Source from the content-addressed store, hash-verified

182
183
184def commit(
185 message: str,
186 args: Sequence[str] = (),
187 committer_date: str | None = None,
188) -> cmd.Command:
189 f = NamedTemporaryFile("wb", delete=False)
190 f.write(message.encode("utf-8"))
191 f.close()
192
193 cmd_args = ["git", "commit"]
194 if args:
195 cmd_args.extend(args)
196 cmd_args.extend(["-F", f.name])
197
198 env: dict[str, str] | None = None
199 if committer_date:
200 env = {"GIT_COMMITTER_DATE": committer_date}
201
202 c = cmd.run(cmd_args, env=env)
203 os.unlink(f.name)
204 return c
205
206
207def get_commits(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected