Skip to content

Commit

Permalink
Create a main alias for master channel. (#115388)
Browse files Browse the repository at this point in the history
* Create a main alias for master channel.

To slowly migrate away from master branch in the flutter repository we
created a main branch that is mirroring master branch. This PR is also
adding a channel alias that will allow to use master/main interchangeably.

Bug: flutter/flutter#95041

* Fix channel tests.

* Remove additional space.
  • Loading branch information
godofredoc authored Nov 16, 2022
1 parent 93c4b09 commit 2c1536a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/flutter_tools/lib/src/persistent_tool_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class _DefaultPersistentToolState implements PersistentToolState {
static const String _kRedisplayWelcomeMessage = 'redisplay-welcome-message';
static const Map<Channel, String> _lastActiveVersionKeys = <Channel,String>{
Channel.master: 'last-active-master-version',
Channel.main: 'last-active-main-version',
Channel.beta: 'last-active-beta-version',
Channel.stable: 'last-active-stable-version',
};
Expand Down
3 changes: 2 additions & 1 deletion packages/flutter_tools/lib/src/version.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,16 @@ const Map<String, String> kObsoleteBranches = <String, String>{

/// The names of each channel/branch in order of increasing stability.
enum Channel {
// TODO(fujino): update to main https://github.com/flutter/flutter/issues/95041
master,
main,
beta,
stable,
}

// Beware: Keep order in accordance with stability
const Set<String> kOfficialChannels = <String>{
globals.kDefaultFrameworkChannel,
'main',
'beta',
'stable',
};
Expand Down
2 changes: 2 additions & 0 deletions packages/flutter_tools/test/general.shard/channel_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ void main() {
command: <String>['git', 'branch', '-r'],
stdout: 'origin/beta\n'
'origin/master\n'
'origin/main\n'
'origin/stable\n',
),
);
Expand All @@ -90,6 +91,7 @@ void main() {
stdout: 'origin/beta\n'
'origin/master\n'
'origin/dependabot/bundler\n'
'origin/main\n'
'origin/v1.4.5-hotfixes\n'
'origin/stable\n',
),
Expand Down

0 comments on commit 2c1536a

Please sign in to comment.