Return new SHA on file update, else 409 Conflict + improve last_commit_id docs
Hi,
I was disappointed to see that unlike GitHub and BitBucket you can't pass a SHA to https://docs.gitlab.com/ee/api/repository_files.html#update-existing-file-in-repository
This makes this endpoint unsafe, at best we have to fetch the file contents and generate our own sha, then update and hope that nobody else updated the file in that time.
This endpoint should take a commit SHA and return a 409 Conflict if it doesn't match, it's the only safe way to update a file. As it stands it means that GitLab is awkward and unsafe for some cases for using the API.
It should also return an updated SHA so we can perform safe updates in the future.
Thanks!
Edited by Dominic