Skip to content

Commit 0eccb1c

Browse files
authored
Merge pull request #132 from Nerixyz/fix/empty-commit
fix: support empty commits/PRs
2 parents c373d72 + 991b995 commit 0eccb1c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

post/clang_tidy_review/clang_tidy_review/__init__.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -286,14 +286,17 @@ def pull_request(self):
286286
self._pull_request = self.repo.get_pull(int(self.pr_number))
287287
return self._pull_request
288288

289-
def get_pr_diff(self) -> List[unidiff.PatchSet]:
289+
def get_pr_diff(self) -> List[unidiff.PatchedFile]:
290290
"""Download the PR diff, return a list of PatchedFile"""
291291

292292
_, data = self.repo._requester.requestJsonAndCheck(
293293
"GET",
294294
self.pull_request.url,
295295
headers={"Accept": f"application/vnd.github.{'v3.diff'}"},
296296
)
297+
if not data:
298+
return []
299+
297300
diffs = data["data"]
298301

299302
# PatchSet is the easiest way to construct what we want, but the

0 commit comments

Comments
 (0)