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

Commits on Oct 20, 2021

  1. Auto merge of rust-lang#9979 - ehuss:git-fetch-force, r=alexcrichton

    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
    bors authored and ehuss committed Oct 20, 2021
    Configuration menu
    Copy the full SHA
    ffa597e View commit details
    Browse the repository at this point in the history