-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add API to get commit diff/patch #17095
Conversation
could you write a very simple integration test (one download of a patch and one for diff) ... |
Is 67ebe50 enough? (test contains an error, will fix it asap) |
Codecov Report
@@ Coverage Diff @@
## main #17095 +/- ##
==========================================
- Coverage 45.25% 45.25% -0.01%
==========================================
Files 773 773
Lines 86828 86842 +14
==========================================
+ Hits 39291 39297 +6
+ Misses 41188 41187 -1
- Partials 6349 6358 +9
Continue to review full report at Codecov.
|
Just a question, nothing that should be done in this PR: as @6543 suggested, I merged the two endpoints into one. Is there a certain reason why there are two endpoints for the PRs? One for diff and one for patch? To keep it consistent, it may be good to merge them into one. |
@qwerty287 as I can see they can be merged too |
it would be breaking in terms of swagger doc but not for api - so I would say it's good to go yes if you would open another pull I'm happy to look at it |
Ok I think I'd like to do this |
This PR adds an API endpoint to get the diff or patch file of a commit. It uses the same mechanism as the "site"
<host>/<owner>/<repo>/commit/<sha>.<diff or patch>
.Endpoints:
Get diff
/repos/{owner}/{repo}/git/commits/{sha}.diff
Get patch
/repos/{owner}/{repo}/git/commits/{sha}.patch
Could close #10921 #13012