Not the entire diff is returned using the API request for the merge request's changes
Summary
According to our merge requests API documentation, when we request the changes of one specific merge request, in the diff part of the response, the full diff contains a header --- a/VERSION\ +++ b/VERSION\, but when we request it using the API, it does not contain it.
Example Project
https://gitlab.com/api/v4/projects/ana-karabanova%2ftest-mr-diff/merge_requests/1/changes
- a test MR where this issue reproduces
What is the current bug behavior?
The diff is not displayed as it should be : "diff": "@@ -1 +1 @@\ -1.9.7\ +1.9.8" instead of "diff": "--- a/VERSION\ +++ b/VERSION\ @@ -1 +1 @@\ -1.9.7\ +1.9.8",
Investigation (by @vyaklushin)
There is a Unified format for diff: https://www.gnu.org/software/diffutils/manual/html_node/Example-Unified.html. Our API responses doesn't match it. A possible reason is an accidental change in the past.
We can extend API to add a new field unidiff with a fully compatible Unified diff syntax.