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

fix: check if rev is full commit sha for github fast path #13969

Merged
merged 1 commit into from
May 27, 2024

Conversation

weihanglo
Copy link
Member

@weihanglo weihanglo commented May 27, 2024

What does this PR try to resolve?

This adds a check when parsing revision as an oid.
libgit2 zero-pads revisions, which we've seen in #13188,
and was introduced by #13946

How should we test and review this PR?

Testings GitHub specific code path needs more efforts, so I didn't include any.
Here are manual test steps.

cargo new foo --lib
cd foo
cargo add --git https://github.com/weihanglo/empty-library --rev 21d408eccb
rm -rf "~/.cargo/git/{checkouts,db}/empty-library-*"
cargo +nightly fetch # expect to fail
./target/debug/cargo fetch # expect to work
CARGO_NET_GIT_FETCH_WITH_CLI=true ./target/debug/cargo fetch --verbose # expect work

Additional information

Fixes #13968

@rustbot
Copy link
Collaborator

rustbot commented May 27, 2024

r? @ehuss

rustbot has assigned @ehuss.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-git Area: anything dealing with git S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 27, 2024
@epage
Copy link
Contributor

epage commented May 27, 2024

@bors r+

@bors
Copy link
Contributor

bors commented May 27, 2024

📌 Commit 26c88db has been approved by epage

It is now in the queue for this repository.

@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 May 27, 2024
@bors
Copy link
Contributor

bors commented May 27, 2024

⌛ Testing commit 26c88db with merge 95eeafa...

@bors
Copy link
Contributor

bors commented May 27, 2024

☀️ Test successful - checks-actions
Approved by: epage
Pushing 95eeafa to master...

@bors bors merged commit 95eeafa into rust-lang:master May 27, 2024
21 checks passed
@weihanglo weihanglo deleted the full-commit-sha branch May 27, 2024 14:47
bors added a commit to rust-lang-ci/rust that referenced this pull request May 28, 2024
Update cargo

5 commits in a8d72c675ee52dd57f0d8f2bae6655913c15b2fb..431db31d0dbeda320caf8ef8535ea48eb3093407
2024-05-24 03:34:17 +0000 to 2024-05-28 18:17:31 +0000
- Include `lints.rust.unexpected_cfgs.check-cfg` in the fingerprint (rust-lang/cargo#13958)
- feat(test): Auto-redact elapsed time (rust-lang/cargo#13973)
- chore: Update to snapbox 0.6 (rust-lang/cargo#13963)
- fix: check if rev is full commit sha for github fast path (rust-lang/cargo#13969)
- test: switch from `drop` to `let _` due to nightly rustc change (rust-lang/cargo#13964)

r? ghost
@ehuss ehuss added this to the 1.80.0 milestone Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-git Area: anything dealing with git 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.

Incorrect formatting for git fetch
5 participants