Closed matthiaskrgr closed 5 years ago
$CARGO_HOME/git/db/
contains repos at specific hashes, so checking or updating them seems like a terrible idea? Also, how does one "update it using cargo"? v confused tbh
In .cargo/git we have a "db" dir which contains bare repos and a "checkouts" dir which contains the checked out repos.
When we do cargo install --git
The idea is, instead of cloning into /tmp, check if we have any git-repo-crates installed (as before), if yes, call the function that cargo uses to update (I assume it runs something like "git fetch") the bare repo (for example ~/.cargo/git/db/cargo-update-6ba56231f2c43182). After updating, we check if the git-hash of the installed package matches the tip of the respective branch of the bare repo to find out if the installed package is out of date.
Would you be so kind so as to test with the commit above?
Looks good to me! Thanks a lot!
Released in v1.8.0
, and thanks once more!
Just an idea: instead of cloning the repos into /tmp, it would be awesome if we could instead check if we already have the git repo in ~/CARGO_HOME/git/db/ and if so, update it using cargo and then check "git log" inside the bare repo to determine if the repo needs to be updated.