(source: Mapping[str, str] | None = None)
| 195 | |
| 196 | |
| 197 | def build_git_env(source: Mapping[str, str] | None = None) -> dict[str, str]: |
| 198 | source = source or os.environ |
| 199 | result = { |
| 200 | "GIT_TERMINAL_PROMPT": "0", |
| 201 | "GIT_ASKPASS": "/bin/false", |
| 202 | "SSH_ASKPASS": "/bin/false", |
| 203 | "GIT_CONFIG_NOSYSTEM": "1", |
| 204 | "GIT_CONFIG_GLOBAL": "/dev/null", |
| 205 | "GIT_LFS_SKIP_SMUDGE": "1", |
| 206 | "LC_ALL": "C.UTF-8", |
| 207 | } |
| 208 | for key in ("PATH", "SYSTEMROOT"): |
| 209 | if source.get(key): |
| 210 | result[key] = source[key] |
| 211 | return result |
| 212 | |
| 213 | |
| 214 | def _git_command(*args: str) -> list[str]: |
no test coverage detected