@@ -18,7 +18,6 @@ import 'common/repository_package.dart';
1818const int _kExitPackageMalformed = 3 ;
1919const int _kGitFailedToPush = 4 ;
2020
21-
2221/// A command to create a remote branch with release changes for a single package.
2322class BranchForBatchReleaseCommand extends PackageCommand {
2423 /// Creates a new `branch-for-batch-release` command.
@@ -65,10 +64,9 @@ class BranchForBatchReleaseCommand extends PackageCommand {
6564 final GitDir repository = await gitDir;
6665
6766 print ('Parsing package "${package .displayName }"...' );
68- final List <PendingChangelogEntry > pendingChangelogs =
69- < PendingChangelogEntry > [];
67+ final List <PendingChangelogEntry > pendingChangelogs;
7068 try {
71- pendingChangelogs. addAll ( package.getPendingChangelogs () );
69+ pendingChangelogs = package.getPendingChangelogs ();
7270 } on FormatException catch (e) {
7371 printError ('Failed to parse pending changelogs: ${e .message }' );
7472 throw ToolExit (_kExitPackageMalformed);
@@ -112,8 +110,7 @@ class BranchForBatchReleaseCommand extends PackageCommand {
112110 /// This method read through the parsed changelog entries decide the new version
113111 /// by following the version change rules. See [_VersionChange] for more details.
114112 _ReleaseInfo _getReleaseInfo (
115- List <PendingChangelogEntry > pendingChangelogEntries,
116- Version oldVersion) {
113+ List <PendingChangelogEntry > pendingChangelogEntries, Version oldVersion) {
117114 final List <String > changelogs = < String > [];
118115 int versionIndex = VersionChange .skip.index;
119116 for (final PendingChangelogEntry entry in pendingChangelogEntries) {
@@ -126,8 +123,7 @@ class BranchForBatchReleaseCommand extends PackageCommand {
126123 final Version ? newVersion = switch (effectiveVersionChange) {
127124 VersionChange .skip => null ,
128125 VersionChange .major => Version (oldVersion.major + 1 , 0 , 0 ),
129- VersionChange .minor =>
130- Version (oldVersion.major, oldVersion.minor + 1 , 0 ),
126+ VersionChange .minor => Version (oldVersion.major, oldVersion.minor + 1 , 0 ),
131127 VersionChange .patch =>
132128 Version (oldVersion.major, oldVersion.minor, oldVersion.patch + 1 ),
133129 };
@@ -238,8 +234,6 @@ class BranchForBatchReleaseCommand extends PackageCommand {
238234 }
239235}
240236
241-
242-
243237/// A data class for processed release information.
244238class _ReleaseInfo {
245239 /// Creates a new instance.
0 commit comments