-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make File.fileSha optional. #392
Make File.fileSha optional. #392
Conversation
GitHub API for comparing commits returns a null "sha" field when the only change to a file is to its file system permissions. See the following repository for a complete example. https://github.com/scott-fleischman/repo-change-file-permission Example API call: https://api.github.com/repos/scott-fleischman/repo-change-file-permission/compare/80fdf8f83fcd8181411919fbf47394b878c591a0...77a95bbebeb78f4fb25c6a10c3c940b6fe1caa27 Response highlight: ``` "files": [ { "sha": null, "filename": "echo-script", "status": "modified", "additions": 0, "deletions": 0, "changes": 0, "blob_url": "https://github.com/scott-fleischman/repo-change-file-permission/blob/77a95bbebeb78f4fb25c6a10c3c940b6fe1caa27/echo-script", "raw_url": "https://github.com/scott-fleischman/repo-change-file-permission/raw/77a95bbebeb78f4fb25c6a10c3c940b6fe1caa27/echo-script", "contents_url": "https://api.github.com/repos/scott-fleischman/repo-change-file-permission/contents/echo-script?ref=77a95bbebeb78f4fb25c6a10c3c940b6fe1caa27" } ] ```
This PR also:
|
@@ -188,7 +188,7 @@ data File = File | |||
, fileStatus :: !Text | |||
, fileRawUrl :: !(Maybe URL) | |||
, fileAdditions :: !Int | |||
, fileSha :: !Text | |||
, fileSha :: !(Maybe Text) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
related <*> o .: "sha"
is better changed to <*> o .:? "sha"
, except if there is really good reason to require null
existence?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good call! Fixed in ffed981
@phadej is there anything else you would like done on this PR? |
…ha-permission-change Conflicts: samples/github-samples.cabal
Looks like you may be back @phadej . Please let me know what I can do to get this change (or a similar one) merged so we can use this project rather than our fork. Thanks! |
GitHub API for comparing commits returns a null "sha" field when the only change to a file is to its file system permissions.
See the following repository for a complete example.
https://github.com/scott-fleischman/repo-change-file-permission
Example API call:
https://api.github.com/repos/scott-fleischman/repo-change-file-permission/compare/80fdf8f83fcd8181411919fbf47394b878c591a0...77a95bbebeb78f4fb25c6a10c3c940b6fe1caa27
Response highlight: