Add context-aware git provider retrieval and refactor related functions

This commit is contained in:
mrT23
2024-06-19 09:41:53 +03:00
parent 025a14014a
commit a710f3ff43

View File

@ -46,9 +46,10 @@ class GithubProvider(GitProvider):
self.incremental = incremental self.incremental = incremental
if self.incremental.is_incremental: if self.incremental.is_incremental:
self.unreviewed_files_set = dict() self.unreviewed_files_set = dict()
self.get_incremental_commits() self._get_incremental_commits()
self.last_commit_id = self.pr_commits[-1] self.last_commit_id = self.pr_commits[-1]
def is_supported(self, capability: str) -> bool: def is_supported(self, capability: str) -> bool:
return True return True
@ -59,7 +60,7 @@ class GithubProvider(GitProvider):
self.repo, self.pr_num = self._parse_pr_url(pr_url) self.repo, self.pr_num = self._parse_pr_url(pr_url)
self.pr = self._get_pr() self.pr = self._get_pr()
def get_incremental_commits(self): def _get_incremental_commits(self):
if not self.pr_commits: if not self.pr_commits:
self.pr_commits = list(self.pr.get_commits()) self.pr_commits = list(self.pr.get_commits())