mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Updating git integration to account for detached HEAD: Also updating tests
This commit is contained in:
parent
4454eb7fce
commit
5acc09d88c
2 changed files with 8 additions and 6 deletions
|
|
@ -1,3 +1,4 @@
|
|||
from resource import error
|
||||
from django.conf import settings
|
||||
from evennia import CmdSet, InterruptCommand
|
||||
from evennia.utils.utils import list_to_string
|
||||
|
|
@ -43,7 +44,12 @@ class GitCommand(MuxCommand):
|
|||
raise InterruptCommand
|
||||
|
||||
self.commit = self.repo.head.commit
|
||||
self.branch = self.repo.active_branch.name
|
||||
|
||||
try:
|
||||
self.branch = self.repo.active_branch.name
|
||||
except TypeError as type_err:
|
||||
self.caller.msg(type_err)
|
||||
raise InterruptCommand
|
||||
|
||||
def short_sha(self, repo, hexsha):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -75,11 +75,7 @@ class TestGitIntegration(EvenniaTest):
|
|||
|
||||
class TestGitEvennia(BaseEvenniaCommandTest):
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
try:
|
||||
self.repo = git.Repo(settings.EVENNIA_DIR, search_parent_directories=True)
|
||||
except git.exc.InvalidGitRepositoryError:
|
||||
print("Test TestGitEvennia failed, unable to find Evennia directory.")
|
||||
super().setUp()
|
||||
self.commit = self.repo.head.commit
|
||||
self.branch = self.repo.active_branch.name
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue