Skip to content

Commit bb17688

Browse files
committed
Fix GitPython repo interaction as per gitpython-developers/GitPython#287
1 parent 8988381 commit bb17688

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cm/master.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import threading
1010
import time
1111

12-
from git import Repo, InvalidGitRepositoryError
12+
import git
1313

1414
from cm.instance import Instance
1515
from cm.services import ServiceRole
@@ -780,7 +780,7 @@ def _get_remote_url(repo):
780780
repo_path = self.app.path_resolver.galaxy_home
781781
try:
782782
if os.path.exists(repo_path):
783-
repo = Repo(repo_path)
783+
repo = git.Repo(repo_path, odbt=git.GitCmdObjectDB)
784784
if repo and not repo.bare:
785785
hexsha = repo.head.commit.hexsha
786786
authored_date = time.strftime("%d %b %Y", time.gmtime(
@@ -789,7 +789,7 @@ def _get_remote_url(repo):
789789
repo_url = _get_remote_url(repo)
790790
return {'hexsha': hexsha, 'authored_date': authored_date,
791791
'active_branch': active_branch, 'repo_url': repo_url}
792-
except InvalidGitRepositoryError:
792+
except git.InvalidGitRepositoryError:
793793
log.debug("No git repository at {0}?".format(repo_path))
794794
return {}
795795

0 commit comments

Comments
 (0)