Fix GitLab provider to use default branch instead of target branch for repo settings

This commit is contained in:
mrT23
2025-03-29 19:39:56 +03:00
parent 7d47bd5f5e
commit 02d9aed7fe

View File

@ -515,7 +515,8 @@ class GitLabProvider(GitProvider):
def get_repo_settings(self):
try:
contents = self.gl.projects.get(self.id_project).files.get(file_path='.pr_agent.toml', ref=self.mr.target_branch).decode()
main_branch = self.gl.projects.get(self.id_project).default_branch
contents = self.gl.projects.get(self.id_project).files.get(file_path='.pr_agent.toml', ref=main_branch).decode()
return contents
except Exception:
return ""