From 1cdca1c8fcbc0a0711ca805122f644cca5053afa Mon Sep 17 00:00:00 2001 From: "Mateus Felipe C. C. Pinto" Date: Wed, 13 Mar 2024 15:32:47 -0300 Subject: [PATCH] fix: fix git dependencies comparison on bootstrap Signed-off-by: Mateus Felipe C. C. Pinto --- packages/melos/lib/src/commands/bootstrap.dart | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/melos/lib/src/commands/bootstrap.dart b/packages/melos/lib/src/commands/bootstrap.dart index 00c43090..887f6f35 100644 --- a/packages/melos/lib/src/commands/bootstrap.dart +++ b/packages/melos/lib/src/commands/bootstrap.dart @@ -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? workspaceDependencies, @@ -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; });