Skip to content

Commit

Permalink
feat: diplays the repo if error GitError
Browse files Browse the repository at this point in the history
  • Loading branch information
SteBaum committed Sep 9, 2024
1 parent de8296e commit 6a40b12
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tdp/core/repository/git_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from collections.abc import Generator, Iterable
from contextlib import contextmanager

from git import BadName, InvalidGitRepositoryError, NoSuchPathError, Repo
from git import BadName, GitError, InvalidGitRepositoryError, NoSuchPathError, Repo

from tdp.core.repository.repository import (
EmptyCommit,
Expand Down Expand Up @@ -74,7 +74,10 @@ def current_version(self) -> str:
raise NoVersionYet from e

def is_clean(self) -> bool:
return not self._repo.is_dirty(untracked_files=True)
try:
return not self._repo.is_dirty(untracked_files=True)
except Exception as e:
raise GitError(f"Error for the repository: {self.path}") from e

def is_file_modified(self, commit: str, path: PathLike) -> bool:
with self._lock:
Expand Down

0 comments on commit 6a40b12

Please sign in to comment.