killercup / killercup/cargo-edit

Error: The repo at path ... is unusable due to having an invalid HEAD reference

Open
#879 3 comments 5 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
3.5k
Forks
166
PR merge metrics
No merged PRs in 30d

Description

When I run `cargo-upgrade upgrade` I get:

```
Error: The repo at path /home/gabor/.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)
```

Apparently this was caused by me Ctrl-C-in a previous run of `cargo-upgrade upgrade` that seemed to have been stuck (not showing anything for more than a minute) After removing that folder and running `cargo-upgrade upgrade` again (and Ctrl-C-ing again) I get the same error.

Contributor guide

Open the contributing guide

Research direction

Start with the `cargo-upgrade upgrade` entry point and reproduce the failure by interrupting a run, then inspect how the cargo registry index is handled afterward. Done means an interrupted upgrade does not leave the index unusable or cause subsequent upgrades to fail with an invalid HEAD reference.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, rust
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.