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

Warn if using hash in git URL, Fixes #8241 #8297

Merged
merged 4 commits into from
Jun 1, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/cargo/util/toml/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1611,6 +1611,18 @@ impl DetailedTomlDependency {
}
}

if let Some(git) = self.git.clone() {
mjarkk marked this conversation as resolved.
Show resolved Hide resolved
if let Ok(url) = git.into_url() {
if url.fragment().is_some() {
let msg = format!(
"hash in git url is ignored for dependency ({}). \
if you were trying to specify a specific git revision, use rev = \"revision\".",
mjarkk marked this conversation as resolved.
Show resolved Hide resolved
name_in_toml);
cx.warnings.push(msg)
}
}
}

let new_source_id = match (
self.git.as_ref(),
self.path.as_ref(),
Expand Down