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

Error when using with CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse #679

Closed
ChriFo opened this issue May 24, 2023 · 2 comments · Fixed by #719
Closed

Error when using with CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse #679

ChriFo opened this issue May 24, 2023 · 2 comments · Fixed by #719
Labels
bug Not as expected

Comments

@ChriFo
Copy link
Contributor

ChriFo commented May 24, 2023

When enabling the new index protocol with e.g. the env variable CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse I get the following error when running cargo release patch:

$ cargo release patch
error: The repo at path /usr/local/cargo/registry/index/github.com-1ecc6299db9ec823 is unusable due to having an invalid HEAD reference: reference 'refs/heads/main' not found; class=Reference (4); code=NotFound (-3)

There is no github.com-* folder but a directory starting with index.crates.io.

@epage epage added the bug Not as expected label May 24, 2023
@cadubentzen
Copy link

cadubentzen commented Jun 24, 2023

This also happened to me.
Since the sparse protocol is default as of 1.70.0, this becomes more likely to occur.
Workaround for me was setting this in ~/.cargo/config.toml:

[registries.crates-io]
protocol = "git"

@PatOConnor43
Copy link

I ran into this using cargo-release 0.24.11. I am also using Rust 1.70.0. I tried adding the ~/.cargo/config.toml workaround that was suggested above. I wasn't able to successfully cargo release patch until I ran cargo update. I'm good to go now though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not as expected
Projects
None yet
4 participants