Skip to content

Commit 2455ccc

Browse files
committed
fix(pr): return statuses for head commit
Based on the code, it doesn't make much sense to fetch »all« commits to just take the last one, i.e., the head commit of the PR. Therefore switch to using the head commit property directly instead of list of all commits that's not even used. Signed-off-by: Matej Focko <[email protected]>
1 parent f94370a commit 2455ccc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ogr/services/base.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ def search(
7979
)
8080

8181
def get_statuses(self) -> Union[list[CommitFlag], Iterable[CommitFlag]]:
82-
commit = self.get_all_commits()[-1]
82+
# [NOTE] Is there any reason we fetch all commits, instead of using the
83+
# head commit on the PR?
84+
# commit = self.get_all_commits()[-1]
85+
commit = self.head_commit
8386
return self.target_project.get_commit_statuses(commit)
8487

8588

0 commit comments

Comments
 (0)