git-lfs gitlab interoperability fix

git-lfs: Fix interoperability with gitlab's implementation of the git-lfs
protocol, which requests Content-Encoding chunked.

Sponsored-by: Dartmouth College's Datalad project
This commit is contained in:
Joey Hess 2021-11-10 13:51:11 -04:00
parent dee462f536
commit f3326b8b5a
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
8 changed files with 105 additions and 11 deletions

View file

@ -457,7 +457,11 @@ store rs h = fileStorer $ \k src p -> getLFSEndpoint LFS.RequestUpload h >>= \ca
(req, sha256, size) <- mkUploadRequest rs k src
sendTransferRequest req endpoint >>= \case
Right resp -> do
body <- liftIO $ httpBodyStorer src p
let body (LFS.ServerSupportsChunks ssc) =
if ssc
then httpBodyStorerChunked src p
else RequestBodyIO $
httpBodyStorer src p
forM_ (LFS.objects resp) $
send body sha256 size
Left err -> giveup err