cargo-edit icon indicating copy to clipboard operation
cargo-edit copied to clipboard

cargo upgrade fails when replacing crates-io with another registry

Open aj9411 opened this issue 2 years ago • 1 comments

Hello, I am not using crates-io, my config.toml looks like this:

[registries]
my-registry = { index = "sparse+https://<my-registry-package-endpoint>" }

[source.crates-io]
replace-with = "my-registry"

I can build fine with cargo build, cargo update works fine to update my Cargo.lock file, but running cargo upgrade -v is failing with this error:

Error: The repo at path ....\.cargo\registry\index\<repo url> is unusable due to having an invalid HEAD reference: reference 'refs/heads/master' not found; class=Reference (4); code=NotFound (-3)

Any ideas on what I could do to get past this problem?

aj9411 avatar Jul 27 '23 21:07 aj9411

This might be caused by using the sparse registry protocol. I've opened a separate issue for that: #868

amsam0 avatar Aug 08 '23 21:08 amsam0