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

[beta] Fix fetching git repos after a force push. #9988

Merged
merged 1 commit into from
Oct 21, 2021

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Oct 20, 2021

Beta backport of #9979.

Fix fetching git repos after a force push.

Users have been reporting that the index has not been updating for them.  This was caused by the update to libgit2 1.3 (from 1.1) which has changed some behavior around force pushes.  The index was squashed on 2021-09-24, and if a user had the index fetched from before that point, and they used nightly-2021-10-14 or newer, then the fetch would succeed, but the `refs/remotes/origin/HEAD` would not get updated.  Cargo uses the `origin/HEAD` ref to know what to look at, and thus was looking at old data.

The solution here is to use `+` on the refspec to force libgit2 to do a forced update (a fast-forward). I think this may have been introduced in libgit2 1.2 via libgit2/libgit2#5854, though that is just a guess.

Fixes rust-lang#9976
@rust-highfive
Copy link

r? @alexcrichton

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive
Copy link

⚠️ Warning ⚠️

  • Pull requests are usually filed against the master branch for this repo, but this one is against rust-1.57.0. Please double check that you specified the right target!

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 20, 2021
@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Oct 21, 2021

📌 Commit ffa597e has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 21, 2021
@bors
Copy link
Contributor

bors commented Oct 21, 2021

⌛ Testing commit ffa597e with merge b2e52d7...

@bors
Copy link
Contributor

bors commented Oct 21, 2021

☀️ Test successful - checks-actions
Approved by: alexcrichton
Pushing b2e52d7 to rust-1.57.0...

@bors bors merged commit b2e52d7 into rust-lang:rust-1.57.0 Oct 21, 2021
@ehuss ehuss added this to the 1.57.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants