Check if path is inside a git repository. Searches parent directories if .git is not directly at repo_path, supporting monorepo subdirectories. Args: repo_path: Path to check Returns: True if inside a git repository, False otherwise
(repo_path: Path)
| 134 | |
| 135 | |
| 136 | def is_git_repository(repo_path: Path) -> bool: |
| 137 | """ |
| 138 | Check if path is inside a git repository. |
| 139 | |
| 140 | Searches parent directories if .git is not directly at repo_path, |
| 141 | supporting monorepo subdirectories. |
| 142 | |
| 143 | Args: |
| 144 | repo_path: Path to check |
| 145 | |
| 146 | Returns: |
| 147 | True if inside a git repository, False otherwise |
| 148 | """ |
| 149 | return _get_git_repo(repo_path) is not None |
| 150 | |
| 151 | |
| 152 | def get_git_commit_hash(repo_path: Path) -> str: |
no test coverage detected