Initialize a Git repository when Git is available.
(path: Path)
| 230 | |
| 231 | |
| 232 | def initialize_if_git_available(path: Path) -> bool: |
| 233 | """Initialize a Git repository when Git is available.""" |
| 234 | if not Repository.is_git_installed(): |
| 235 | return False |
| 236 | |
| 237 | subprocess.run(["git", "init"], cwd=path, check=True) # noqa: S607 |
| 238 | return True |
no test coverage detected