Find a git repository starting at repo_path and searching parent directories. Args: repo_path: Path to start searching from Returns: git.Repo instance or None if no repository found
(repo_path: Path)
| 117 | |
| 118 | |
| 119 | def _get_git_repo(repo_path: Path): |
| 120 | """ |
| 121 | Find a git repository starting at repo_path and searching parent directories. |
| 122 | |
| 123 | Args: |
| 124 | repo_path: Path to start searching from |
| 125 | |
| 126 | Returns: |
| 127 | git.Repo instance or None if no repository found |
| 128 | """ |
| 129 | try: |
| 130 | import git |
| 131 | return git.Repo(repo_path, search_parent_directories=True) |
| 132 | except Exception: |
| 133 | return None |
| 134 | |
| 135 | |
| 136 | def is_git_repository(repo_path: Path) -> bool: |
no outgoing calls
no test coverage detected