diff --git a/cli/medperf/utils.py b/cli/medperf/utils.py index 2636c6a9d..a930ffb1b 100644 --- a/cli/medperf/utils.py +++ b/cli/medperf/utils.py @@ -19,7 +19,7 @@ from typing import List from colorama import Fore, Style from pexpect.exceptions import TIMEOUT -from git import Repo, GitCommandError +from git import Repo, GitCommandError, InvalidGitRepositoryError import medperf.config as config from medperf.exceptions import ExecutionError, MedperfException @@ -431,7 +431,11 @@ def filter_latest_associations(associations, entity_key): def check_for_updates() -> None: """Check if the current branch is up-to-date with its remote counterpart using GitPython.""" repo_root_dir = Path(__file__).resolve().parent.parent.parent - repo = Repo(repo_root_dir) + try: + repo = Repo(repo_root_dir) + except InvalidGitRepositoryError: # package is installed not in -e mode from git repo + return + if repo.bare: logging.debug("Repo is bare") return