Error not raised on empty file update via API
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=256263) </details> <!--IssueSummary end--> ### Summary 1. The documentation [states](https://docs.gitlab.com/ee/api/repository_files.html#update-existing-file-in-repository) that PUT method of repository files should return error code 400 if the new file contents are identical to the old ones. 2. This error is not returned, and instead an empty commit is generated. https://gitlab.com/anton-akhmerov/test/-/commit/0f4e8a50aae95177c0b1c35e9ba5e2b2ad143b76 is an example of the empty commit ### Steps to reproduce I used the following script using the python-gitlab wrapper to confirm the behavior on gitlab.com: ```python import gitlab gl = gitlab.Gitlab(url='https://gitlab.com', private_token="<private_token>") p = gl.projects.get('anton-akhmerov/test') f = p.files.get('README.md', 'master') f.save(branch='master', commit_message='Update testfile', encoding='base64') ``` ### Example Project See above. ### What is the current *bug* behavior? Empty commit generated, no error is raised. ### What is the expected *correct* behavior? No empty commit generated, 400 error returned. ### Output of checks This bug happens on GitLab.com <!-- If you can, link to the line of code that might be responsible for the problem. -->
issue