Skip to content

Conversation

@MarijnS95
Copy link

I ended up in the accidental case where my URL is sparse, and believe this could also happen if someone uses replace-with in their .cargo/ config.toml. When GitIndex is created, this ends up with a rather useless error:

Refusing to initialize the non-empty directory as '/home/me/.cargo/registry/index/my-custom-registry'

Because it is probably not finding a git repository at that place, without realizing that it's a sparse index cache.

To solve the replace-with case above, or make this crate more generally usable, shouldn't there be (if there isn't already) a high-level wrapper that automatically delegates to SparseIndex if the URL starts with sparse+, and hide the GitIndex/SparseIndex "internals"?

I ended up in the accidental case where my URL is sparse, and believe
this could also happen if someone uses `replace-with` in their `.cargo/
config.toml`.  When `GitIndex` is created, this ends up with a rather
useless error:

    Refusing to initialize the non-empty directory as '/home/me/.cargo/registry/index/my-custom-registry'

Because it is probably not finding a `git` repository at that place,
without realizing that it's a sparse index cache.

To solve the `replace-with` case above, or make this crate more
generally usable, shouldn't there be (if there isn't already) a
high-level wrapper that automatically delegates to `SparseIndex` if
the URL starts with `sparse+`, and hide the `GitIndex`/`SparseIndex`
"internals"?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant