8000 Support setting oid type for in-memory repositories by kcsaul · Pull Request #6671 · libgit2/libgit2 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support setting oid type for in-memory repositories #6671

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

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

kcsaul
Copy link
Contributor
@kcsaul kcsaul commented Dec 14, 2023

This change adds support for setting oid type when creating an in-memory repository using git_repository_new (in conjunction with using custom backends).

Needed to prevent "ambiguous lookup - OID prefix is too short" error during git_object_lookup_prefix.

@ethomson
Copy link
Member

Great catch. Thanks for the fix.

I wonder if we should take a git_repository_new_options here? The name is a bit regrettable, but matches our style. This could help future-proof that API in case we want to add more things later.

@kcsaul
Copy link
Contributor Author
kcsaul commented Dec 14, 2023

@ethomson - I'd wondered the same thing, but as it appears the basic purpose of git_repository_new is similar to git_index_new for the creation of blank/in-memory structure, it seemed sufficient to take the same approach as git_index_new for the time being at least.

Could be revised if needed later with minimal disruption while it's still behind the experimental feature toggle. My immediate goal was getting things working for my existing use case without the experimental flag enabled as part of upgrading to latest version.

@ethomson ethomson merged commit e020c85 into libgit2:main Dec 14, 2023
@ethomson
Copy link
Member

Makes sense. Thanks again @kcsaul

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0