mirror of
https://github.com/ansible/awx.git
synced 2026-04-14 06:29:25 -02:30
Merge pull request #5460 from AlanCoding/fix_detached
Fix project sync errors when project branch is commit Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
@@ -2183,6 +2183,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
|
||||||
|
|||||||
Reference in New Issue
Block a user