8000 Bypass shallow clone support for in-memory repositories by kcsaul · Pull Request #6684 · libgit2/libgit2 · GitHub
[go: up one dir, main page]

Skip to content

Bypass shallow clone support for in-memory repositories #6684

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 sta 8000 tement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

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

Handles case where determining path to grafts files for shallow clones may fail with 'path cannot exist in repository' for an in-memory repository that doesn't have any directories.

To cater for this, empty grafts are created/set on the repository, and if they're already set, are refreshed upfront rather than attempting to derive the path again.

This change is not intended to support shallow clones for in-memory repositories, rather it's intended to preserve prior behavior where we can at least still perform a full clone for an in-memory repository with a custom database backend, without any files stored on-disk.

If a shallow clone were attempted in this scenario, it's likely/expected to fail when attempting to write grafts to file at the end of the clone. Recommend consideration be given to implementing support for custom grafts backends, or more generally, a virtual file system layer to support custom backends for storing misc. files.

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

@ethomson - The failed test looks like it's an online test detecting a memory leak - I've no idea how I'd have possibly achieved that for just one of the test runs - Is there possibly another intermittent issue at play here with the online tests?

@ethomson
Copy link
Member

@ethomson - The failed test looks like it's an online test detecting a memory leak - I've no idea how I'd have possibly achieved that for just one of the test runs - Is there possibly another intermittent issue at play here with the online tests?

Yes - some of the integration tests that require network connectivity are flaky (as a result of flaky networking, etc). And when we fail quickly out of a test, we will leak memory, which Valgrind shows. I haven't found a good way to really get right with this - in particular, that Windows SHA256 gitdaemon test seems to fail quite frequently. I suspect that there's an underlying bug, either on our side or in the gitdaemon. 🤔

In any case - that's unrelated to this PR. 😁 Apologies for the noise.

@ethomson
Copy link
Member

Recommend consideration be given to implementing support for custom grafts backends, or more generally, a virtual file system layer to support custom backends for storing misc. files.

I agree. I don't know what this looks like (yet) but it's something that we need to figure out.

@ethomson
Copy link
Member

In the meantime, thanks for the fix!

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