Skip to content

Commit 6a40b12

Browse files
committed
feat: diplays the repo if error GitError
1 parent de8296e commit 6a40b12

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tdp/core/repository/git_repository.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from collections.abc import Generator, Iterable
88
from contextlib import contextmanager
99

10-
from git import BadName, InvalidGitRepositoryError, NoSuchPathError, Repo
10+
from git import BadName, GitError, InvalidGitRepositoryError, NoSuchPathError, Repo
1111

1212
from tdp.core.repository.repository import (
1313
EmptyCommit,
@@ -74,7 +74,10 @@ def current_version(self) -> str:
7474
raise NoVersionYet from e
7575

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

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

0 commit comments

Comments
 (0)