(
message: str,
args: Sequence[str] = (),
committer_date: str | None = None,
)
| 182 | |
| 183 | |
| 184 | def 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 | |
| 207 | def get_commits( |
nothing calls this directly
no outgoing calls
no test coverage detected