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

Multiple git dependencies with the same tag trigger assertion on checkout.is_fresh() #3580

Closed
quodlibetor opened this issue Jan 23, 2017 · 2 comments · Fixed by #3583
Closed
Labels
C-bug Category: bug

Comments

@quodlibetor
Copy link

quodlibetor commented Jan 23, 2017

With a Cargo.toml that includes:

[dependencies]
serde = { git = "https://github.com/serde-rs/serde", rev = "v0.9.0-rc2" }
serde_derive = { git = "https://github.com/serde-rs/serde", rev = "v0.9.0-rc2"}

I hit the thread 'main' panicked at 'assertion failed: checkout.is_fresh()', src/cargo/sources/git/utils.rs:183 bug that was last seen in #2271.

Running with:

[dependencies]
serde = { git = "https://github.com/serde-rs/serde", rev = "1e05fc21457b838" }
serde_derive = { git = "https://github.com/serde-rs/serde", rev = "1e05fc21457b838"}

works fine.

$ cargo --version
cargo 0.17.0-nightly (2324c2b 2017-01-21)
@alexcrichton alexcrichton added the C-bug Category: bug label Jan 23, 2017
@alexcrichton
Copy link
Member

I'll fix the assertion failure here, but @quodlibetor in the meantime you should be able to use tag = 'v0.9.0' and such to fix this problem locally.

alexcrichton added a commit to alexcrichton/cargo that referenced this issue Jan 23, 2017
Previously if a rev was specified as a tag then we'd trip an assertion because
resetting to that tag would reset to the tag that the commit pointed to, which
would then cause the head id of the repo to be different than what we thought it
was.

Instead, we handle the case where a `rev` specification is a tag explicitly by
using the tag's target id as the revision that we're going to check out, not the
id of the tag itself.

Closes rust-lang#3580
@quodlibetor
Copy link
Author

Confirmed, using tag does indeed fix it.

bors added a commit that referenced this issue Feb 8, 2017
Handle `rev` being a `tag`

Previously if a rev was specified as a tag then we'd trip an assertion because
resetting to that tag would reset to the tag that the commit pointed to, which
would then cause the head id of the repo to be different than what we thought it
was.

Instead, we handle the case where a `rev` specification is a tag explicitly by
using the tag's target id as the revision that we're going to check out, not the
id of the tag itself.

Closes #3580
@bors bors closed this as completed in #3583 Feb 8, 2017
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

Successfully merging a pull request may close this issue.

2 participants