Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lfs: default to basic transfer API #298

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

sisp
Copy link
Collaborator

@sisp sisp commented Jan 11, 2024

I've fixed the download of LFS objects when the Batch API response does not contain a transfer property. In this case, the transfer property should default to "basic". This behavior conforms with the spec:

All Git LFS clients and servers SHOULD support it, and default to it if the Batch API request or response do not specify a transfer property.

For instance, GitLab's LFS server does not provide the transfer property, which causes scmrepo to fail with:

.../scmrepo/git/lfs/client.py", line 201, in _download
    raise LFSError("Unsupported LFS transfer type")

After this fix, downloading LFS objects from GitLab works.

@skshetry skshetry requested a review from pmrowla January 11, 2024 13:56
@pmrowla pmrowla self-assigned this Jan 11, 2024
@pmrowla pmrowla added the lfs Related to Git-LFS support label Jan 11, 2024
@pmrowla pmrowla merged commit 70bdaef into iterative:main Jan 11, 2024
11 of 13 checks passed
@pmrowla
Copy link
Contributor

pmrowla commented Jan 11, 2024

Thanks for catching this @sisp!

scmrepo==2.0.3 is now released with this fix

@sisp sisp deleted the fix/lfs-transfer-default branch January 11, 2024 14:58
@sisp
Copy link
Collaborator Author

sisp commented Jan 11, 2024

Thanks for the quick review, merge and release, @pmrowla! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lfs Related to Git-LFS support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants