Allow downloading LFS binary data via API
requested to merge 27892-cannot-download-lfs-binary-data-via-api-just-downloads-the-pointer-file into master
What does this MR do and why?
Allow downloading files tracked with Git LFS via API
When a request is made with the lfs query parameter for files that are tracked via Git LFS, the reponse should be the binary data rather than the pointer file
Contributes to: #27892 (closed)
How to set up and validate locally
- Set up a project with lfs enabled
- Add some files tracked with git lfs For example
git lfs track `*.txt`
echo 'hello' > hello.txt
- Make a request to the files api with the lfs parameter for the binary data and see that the response is the file contents(e.g For example
curl 127.0.0.1:3000/api/v4/projects/23/repository/files/hello.txt/raw?lfs=true
=> hello
- Make a request to the files api without the lfs parameter (and/or lfs=false) and see that response is the lfs text pointer
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #27892 (closed)
Edited by Jerry Seto