Merge pull request #4026 from AlanCoding/fix_detached_36

[3.6.2] Fix project sync errors when project branch is commit
This commit is contained in:
Ryan Petrello
2019-12-06 14:33:10 -05:00
committed by GitHub

View File

@@ -2214,6 +2214,9 @@ class RunProjectUpdate(BaseTask):
project_path = instance.project.get_project_path(check_if_exists=False) project_path = instance.project.get_project_path(check_if_exists=False)
if os.path.exists(project_path): if os.path.exists(project_path):
git_repo = git.Repo(project_path) git_repo = git.Repo(project_path)
if git_repo.head.is_detached:
self.original_branch = git_repo.head.commit
else:
self.original_branch = git_repo.active_branch self.original_branch = git_repo.active_branch
@staticmethod @staticmethod