Skip to content

Commit fdd4c30

Browse files
hsbtclaude
andcommitted
Unlock direct deps too for metadata-field overrides
The per-dep loop in converge_dependencies only knows about version: overrides via apply_override_to + matches_spec?. Metadata overrides on direct deps were therefore invisible to lockfile change detection and would silently no-op against an existing lock. Extend converge_overrides_outside_dependencies to also unlock direct deps when the override targets a non-version field. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 853e00f commit fdd4c30

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

bundler/lib/bundler/definition.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1065,8 +1065,11 @@ def converge_overrides_outside_dependencies
10651065

10661066
name = override.target
10671067
next if @changed_dependencies.include?(name)
1068-
next if @dependencies.any? {|d| d.name == name }
10691068
next if @originally_locked_specs[name].empty?
1069+
# version: overrides on direct deps are detected in the per-dep
1070+
# converge_dependencies loop via apply_override_to + matches_spec?.
1071+
# Other fields are not visible there, so they always reach here.
1072+
next if override.field == :version && @dependencies.any? {|d| d.name == name }
10701073

10711074
@gems_to_unlock << name
10721075
@changed_dependencies << name

0 commit comments

Comments
 (0)