Skip to content

Commit

Permalink
fix: fix git dependencies comparison on bootstrap
Browse files Browse the repository at this point in the history
Signed-off-by: Mateus Felipe C. C. Pinto <[email protected]>
  • Loading branch information
mateusfccp committed Mar 13, 2024
1 parent c5ab053 commit 1cdca1c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/melos/lib/src/commands/bootstrap.dart
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,14 @@ mixin _BootstrapMixin on _CleanMixin {
return didUpdate;
}

bool _areDependenciesEqual(DependencyReference? a, DependencyReference? b) {
if (a is GitReference && b is GitReference) {
return a == b && a.path == b.path;
} else {
return a == b;
}
}

int _updateDependencies({
required YamlEditor pubspecEditor,
required Map<String, DependencyReference>? workspaceDependencies,
Expand All @@ -343,7 +351,9 @@ mixin _BootstrapMixin on _CleanMixin {
// dependencies that have a different version specified in the workspace.
final dependenciesToUpdate = workspaceDependencies.entries.where((entry) {
if (!packageDependencies.containsKey(entry.key)) return false;
if (packageDependencies[entry.key] == entry.value) return false;
if (_areDependenciesEqual(packageDependencies[entry.key], entry.value)) {
return false;
}
return true;
});

Expand Down

0 comments on commit 1cdca1c

Please sign in to comment.