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
. WhenGitIndex
is created, this ends up with a rather useless error: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 toSparseIndex
if the URL starts withsparse+
, and hide theGitIndex
/SparseIndex
"internals"?