Skip to content

Commit

Permalink
PortAddonPullRequest: include orphaned commits in user's cache
Browse files Browse the repository at this point in the history
  • Loading branch information
sebalix committed Jan 6, 2025
1 parent 6690e90 commit 7f74e53
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion oca_port/port_addon_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ def get_commits_diff(self):
continue
# Get related Pull Request if any
pr = self._get_original_pr(commit)
if pr:
if pr and pr.number != "_": # _ stands for "Fake PR"
for pr_commit_sha in pr.commits:
try:
raw_commit = self.app.repo.commit(pr_commit_sha)
Expand Down Expand Up @@ -962,3 +962,15 @@ def _get_original_pr(self, commit: g.Commit):
}
self.app.cache.store_commit_pr(commit.hexsha, data)
return g.PullRequest(**data)
else:
# Fake PR hosting orphaned commits
data = {
"number": "_",
"url": "",
"author": "",
"title": "",
"body": "",
"merged_at": "",
"commits": [],
}
self.app.cache.store_commit_pr(commit.hexsha, data)

0 comments on commit 7f74e53

Please sign in to comment.