Patch should be optional on `PullRequestFile`
lloydmeta opened this issue · 0 comments
lloydmeta commented
Why
I think that field may not be populated, esp for binary files. This causes breakage when you try to get files on a pull request.
Proof
Assuming you have jq
installed:
$ curl https://api.github.com/repos/scala/scala/pulls/4877/files | jq '. | map(select(.patch == null))'
[
{
"sha": "7229603ae5b30ce0e0bd09863543b260085c8f2d",
"filename": "src/scaladoc/scala/tools/nsc/doc/html/resource/lib/arrow-down.png",
"status": "removed",
"additions": 0,
"deletions": 0,
"changes": 0,
"blob_url": "https://github.com/scala/scala/blob/da3720e55b3d69cc31ab0f26e6cffafb18da360f/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/arrow-down.png",
"raw_url": "https://github.com/scala/scala/raw/da3720e55b3d69cc31ab0f26e6cffafb18da360f/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/arrow-down.png",
"contents_url": "https://api.github.com/repos/scala/scala/contents/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/arrow-down.png?ref=da3720e55b3d69cc31ab0f26e6cffafb18da360f"
}, ...
]