diff --git a/oca_port/port_addon_pr.py b/oca_port/port_addon_pr.py index a1594de..480d354 100644 --- a/oca_port/port_addon_pr.py +++ b/oca_port/port_addon_pr.py @@ -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) @@ -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)