-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Fix fetching git repos after a force push. #9979
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r? @Eh2406 (rust-highfive has picked a reviewer for you, use r? to override) |
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Oct 18, 2021
Nice find on this! @bors: r+ |
📌 Commit 8d5576b has been approved by |
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 18, 2021
☀️ Test successful - checks-actions |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Oct 19, 2021
Update cargo 6 commits in c7957a74bdcf3b11e7154c1a9401735f23ebd484..7fbbf4e8f23e3c24b8afff541dcb17e53eb5ff88 2021-10-11 20:17:07 +0000 to 2021-10-19 02:16:48 +0000 - Make future-incompat-report output more user-friendly (rust-lang/cargo#9953) - Fix fetching git repos after a force push. (rust-lang/cargo#9979) - Add rustc-link-args to doctest build (rust-lang/cargo#9916) - Add the start of a basic benchmarking suite. (rust-lang/cargo#9955) - Use forms for issue templates. (rust-lang/cargo#9970) - Add rust_metadata to SerializedPackage (rust-lang/cargo#9967)
ehuss
pushed a commit
to ehuss/cargo
that referenced
this pull request
Oct 20, 2021
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
added a commit
that referenced
this pull request
Oct 21, 2021
[beta] Fix fetching git repos after a force push. Beta backport of #9979.
Mark-Simulacrum
added a commit
to Mark-Simulacrum/rust
that referenced
this pull request
Oct 22, 2021
Includes rust-lang/cargo#9979: Fix fetching git repos after a force push.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Oct 22, 2021
…ulacrum [beta] backports * Don't emit a warning for empty rmeta files. rust-lang#90072 * Erase late-bound regions before computing vtable debuginfo name. rust-lang#90050 * Fix wrong niche calculation when 2+ niches are placed at the start rust-lang#90040 * Revert rust-lang#86011 to fix an incorrect bound check rust-lang#90025 * Fix macro_rules! duplication when reexported in the same module rust-lang#89867 * Bump cargo to include rust-lang/cargo#9979 - Fix fetching git repos after a force push. r? `@Mark-Simulacrum`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
beta-nominated
Nominated to backport to the beta branch.
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theorigin/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 #9976