Initialize git manager. Args: repo_path: Path to git repository Raises: RepositoryError: If not a valid git repository
(self, repo_path: Path)
| 23 | """ |
| 24 | |
| 25 | def __init__(self, repo_path: Path): |
| 26 | """ |
| 27 | Initialize git manager. |
| 28 | |
| 29 | Args: |
| 30 | repo_path: Path to git repository |
| 31 | |
| 32 | Raises: |
| 33 | RepositoryError: If not a valid git repository |
| 34 | """ |
| 35 | self.repo_path = Path(repo_path).expanduser().resolve() |
| 36 | |
| 37 | try: |
| 38 | self.repo = git.Repo(repo_path, search_parent_directories=True) |
| 39 | except git.InvalidGitRepositoryError: |
| 40 | raise RepositoryError( |
| 41 | f"Not a git repository: {repo_path}\n\n" |
| 42 | "To initialize a git repository: git init" |
| 43 | ) |
| 44 | |
| 45 | def check_clean_working_directory(self) -> Tuple[bool, str]: |
| 46 | """ |
nothing calls this directly
no test coverage detected