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

force-pushed repositories using branch don't get updated - possible regression #10001

Closed
Sibz opened this issue Oct 22, 2021 · 2 comments
Closed
Labels
C-bug Category: bug

Comments

@Sibz
Copy link

Sibz commented Oct 22, 2021

Problem

I see a similar issue was addressed in #6795 so this is possibly a regression, or perhaps it didn't address the issue when branch is specified.

I am using branch target on my repositories in cargo.toml, when I have to rebase and force push a feature branch, any crates using that feature branch won't update. The first call of cargo update shows updating <git repo>... but doesn't actually do it.
Inspection of the cargo.lock shows the old commit ref is still being used.

Removing the cargo.lock on its own does nothing, but coupled with deleting the repo folder in the cargo/git/db and checkouts folder before cargo update works around the problem.

Steps

Setup a lib crate, create a feature branch.
Add crate into main project using:
crate_name = { git = "repo_url.git", branch = "feature_branch" }
Edit/amend the last commit on the feature branch so the commit ref changes
Force push
Attempt to cargo update on main project
Note the files in checkouts have not updated

Possible Solution(s)

No response

Notes

I did note that when deleting the repo folder in DB and checkouts without deleting the cargo.lock, a reasonable error is displayed advising it can't find the commit ref. Then deleting the cargo.lock would rectify the issue.

Version

cargo 1.57.0-nightly (c7957a74b 2021-10-11)
release: 1.57.0
commit-hash: c7957a74bdcf3b11e7154c1a9401735f23ebd484
commit-date: 2021-10-11
host: x86_64-pc-windows-msvc
libgit2: 1.3.0 (sys:0.13.23 vendored)
libcurl: 7.79.1-DEV (sys:0.4.49+curl-7.79.1 vendored ssl:Schannel)
os: Windows 10.0.19042 (Windows 10 Pro) [64-bit]
@Sibz Sibz added the C-bug Category: bug label Oct 22, 2021
@ehuss
Copy link
Contributor

ehuss commented Oct 22, 2021

I think this may be #9976. Can you try with the latest nightly? I believe the fix landed in nightly-2021-10-20.

@Sibz
Copy link
Author

Sibz commented Oct 22, 2021

@ehuss Thank you, yes this is fixed now. Sorry, I had tried updating when I had the issue but didn't think to update again before lodging the report.

@Sibz Sibz closed this as completed Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants