Skip to content

Commit 95e4e03

Browse files
srawlinscommit-bot@chromium.org
authored andcommitted
Migrator: do not generate edit details twice on rerun
Fixes #44086 Change-Id: I99a23e5922a716bbd0c83e7c0f620686840ccd4c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172300 Reviewed-by: Paul Berry <[email protected]> Commit-Queue: Samuel Rawlins <[email protected]>
1 parent 6b64d52 commit 95e4e03

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pkg/nnbd_migration/lib/src/front_end/non_nullable_fix.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class NonNullableFix {
122122
/// file, and the analysis_options.yaml file, each only if necessary.
123123
///
124124
/// [neededPackages] is a map whose keys are the names of packages that should
125-
/// be dependend upon by the package's pubspec, and whose values are the
125+
/// be depended upon by the package's pubspec, and whose values are the
126126
/// minimum required versions of those packages.
127127
void processPackage(Folder pkgFolder, Map<String, Version> neededPackages) {
128128
var pubspecFile = pkgFolder.getChildAssumingFile('pubspec.yaml');
@@ -156,7 +156,6 @@ class NonNullableFix {
156156
Future<MigrationState> rerun() async {
157157
reset();
158158
var state = await rerunFunction();
159-
await state.refresh(_logger);
160159
return state;
161160
}
162161

pkg/nnbd_migration/lib/src/preview/preview_site.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,9 @@ class PreviewSite extends Site
364364

365365
Future<void> rerunMigration() async {
366366
migrationState = await rerunFunction();
367-
reset();
367+
if (!migrationState.hasErrors) {
368+
reset();
369+
}
368370
}
369371

370372
void reset() {

0 commit comments

Comments
 (0)