Skip to content

Commit f2ef409

Browse files
paveraCopilot
andauthored
Update npm_and_yarn/lib/dependabot/npm_and_yarn/file_updater/package_json_updater.rb
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent e8ed038 commit f2ef409

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

npm_and_yarn/lib/dependabot/npm_and_yarn/file_updater/package_json_updater.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ def updated_package_json_content
6161
# "dependencies" list. For example, the dependencies object can contain same name dependency
6262
# "dep" => "1.0.0" and "dev" => "1.0.1" while package.json can only contain "dep" => "1.0.0".
6363
# The other dependency is not present in package.json so we don't have to update it — this is
64-
# most likely a transitive dependency which only needs an update in the lockfile. We avoid
65-
# throwing an exception and let the update continue.
64+
# most likely a transitive dependency which only needs an update in the lockfile. For a batch
65+
# with a single unique dependency name we tolerate this no-op update, but when multiple unique
66+
# dependencies are being updated and none change the content we treat that as unexpected and raise.
6667
raise "Expected content to change!" if content == new_content && unique_deps_count > 1
6768

6869
content = new_content

0 commit comments

Comments
 (0)