nabijaczleweli / cargo-update

A cargo subcommand for checking and applying updates to installed executables
MIT License
1.25k stars 41 forks source link

fails to find master branch #141

Closed matthiaskrgr closed 4 years ago

matthiaskrgr commented 4 years ago

cargo install-update -ag fails with

No packages need updating.
thread 'main' panicked at 'Local branch master doesn't exist in /home/matthias/.cargo/git/db/cargo-cache-16826c8e13331adc: cannot locate local branch 'master'; class=Reference (4); code=NotFound (-3)', /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-update-4.1.0/src/ops/mod.rs:498:30
stack backtrace:
   0: rust_begin_unwind
             at /rustc/81dc88f88f92ba8ad7465f9cba10c12d3a7b70f1/library/std/src/panicking.rs:475
   1: std::panicking::begin_panic_fmt
             at /rustc/81dc88f88f92ba8ad7465f9cba10c12d3a7b70f1/library/std/src/panicking.rs:429
   2: cargo_update::ops::GitRepoPackage::pull_version_repo::{{closure}}
   3: cargo_update::ops::GitRepoPackage::pull_version_impl
   4: cargo_install_update::actual_main
   5: cargo_install_update::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Removing the directory from git/db so that cargo rebuilds it does not seem to help.

nabijaczleweli commented 4 years ago

That's a weird state for a repository to be in, and I can't reproduce this, short of manually deleting ~/.cargo/git/db/cargo-cache-16826c8e13331adc/refs/heads/master, which I doubt you did.

Weirder still, after removing the directory you should go through a fresh clone, which doesn't go through that part of the funxion at all?

Would you mind posting the packed directory here?

matthiaskrgr commented 4 years ago

You mean an archive of ~/.cargo/git/db/cargo-cache-16826c8e13331adc, right?

cargo-cache-16826c8e13331adc.tar.gz

nabijaczleweli commented 4 years ago

Yeah, that's great! And entirely bizarre.

nabijaczleweli commented 4 years ago

Can you try again with the master branch (at least 988fabea074ee6379b19acab7abf4ad9620d96b4)?

matthiaskrgr commented 4 years ago

Seems to have fixed it, thanks!

nabijaczleweli commented 4 years ago

Released in v4.1.1!