Skip to content

Commit

Permalink
git-updates skipped if package not installed from repo with -e flag
Browse files Browse the repository at this point in the history
  • Loading branch information
VukW committed Apr 10, 2024
1 parent dc136d1 commit 6a83fff
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cli/medperf/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6a83fff

Please sign in to comment.