Skip to content

Commit

Permalink
fix: correctly find workspace.dependencies-declared dependencies and …
Browse files Browse the repository at this point in the history
…their Cargo.toml
  • Loading branch information
poliorcetics authored and jeffwidman committed Jan 10, 2023
1 parent db6310a commit f796a03
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cargo/lib/dependabot/cargo/file_fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,16 @@ def required_path?(file, path)
end
end

# Paths specified for workspace-wide dependencies
workspace = parsed_file(file).fetch("workspace", {})
workspace.fetch("dependencies", {}).each do |_, details|
next unless details.is_a?(Hash)
next unless details["path"]
next unless path == File.join(details["path"], "Cargo.toml")

return true if details["git"].nil?
end

# Paths specified as replacements
parsed_file(file).fetch("replace", {}).each do |_, details|
next unless details.is_a?(Hash)
Expand Down

0 comments on commit f796a03

Please sign in to comment.