Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: diplays the repo if GitError #621

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading