Unverified Commit ce7df25a authored by Anurag Roy's avatar Anurag Roy Committed by GitHub

Move flutterGit from `version.dart` (#79568)

parent 240891fe
...@@ -37,6 +37,9 @@ import 'project.dart'; ...@@ -37,6 +37,9 @@ import 'project.dart';
import 'reporting/reporting.dart'; import 'reporting/reporting.dart';
import 'version.dart'; import 'version.dart';
/// The flutter GitHub repository.
String get flutterGit => platform.environment['FLUTTER_GIT_URL'] ?? 'https://github.com/flutter/flutter.git';
Artifacts? get artifacts => context.get<Artifacts>(); Artifacts? get artifacts => context.get<Artifacts>();
BuildSystem? get buildSystem => context.get<BuildSystem>(); BuildSystem? get buildSystem => context.get<BuildSystem>();
Cache get cache => context.get<Cache>()!; Cache get cache => context.get<Cache>()!;
......
...@@ -14,9 +14,6 @@ import 'cache.dart'; ...@@ -14,9 +14,6 @@ import 'cache.dart';
import 'convert.dart'; import 'convert.dart';
import 'globals_null_migrated.dart' as globals; import 'globals_null_migrated.dart' as globals;
/// The flutter GitHub repository.
String get _flutterGit => globals.platform.environment['FLUTTER_GIT_URL'] ?? 'https://github.com/flutter/flutter.git';
const String _unknownFrameworkVersion = '0.0.0-unknown'; const String _unknownFrameworkVersion = '0.0.0-unknown';
/// The names of each channel/branch in order of increasing stability. /// The names of each channel/branch in order of increasing stability.
...@@ -274,7 +271,7 @@ class FlutterVersion { ...@@ -274,7 +271,7 @@ class FlutterVersion {
'remote', 'remote',
'add', 'add',
_versionCheckRemote, _versionCheckRemote,
_flutterGit, globals.flutterGit,
]); ]);
await _run(<String>['git', 'fetch', _versionCheckRemote, branch]); await _run(<String>['git', 'fetch', _versionCheckRemote, branch]);
return _latestGitCommitDate( return _latestGitCommitDate(
...@@ -284,7 +281,7 @@ class FlutterVersion { ...@@ -284,7 +281,7 @@ class FlutterVersion {
} on VersionCheckError catch (error) { } on VersionCheckError catch (error) {
if (globals.platform.environment.containsKey('FLUTTER_GIT_URL')) { if (globals.platform.environment.containsKey('FLUTTER_GIT_URL')) {
globals.logger.printError('Warning: the Flutter git upstream was overridden ' globals.logger.printError('Warning: the Flutter git upstream was overridden '
'by the environment variable FLUTTER_GIT_URL = $_flutterGit'); 'by the environment variable FLUTTER_GIT_URL = ${globals.flutterGit}');
} }
globals.logger.printError(error.toString()); globals.logger.printError(error.toString());
rethrow; rethrow;
...@@ -632,7 +629,7 @@ class GitTagVersion { ...@@ -632,7 +629,7 @@ class GitTagVersion {
if (channel == 'dev' || channel == 'beta' || channel == 'stable') { if (channel == 'dev' || channel == 'beta' || channel == 'stable') {
globals.printTrace('Skipping request to fetchTags - on well known channel $channel.'); globals.printTrace('Skipping request to fetchTags - on well known channel $channel.');
} else { } else {
_runGit('git fetch $_flutterGit --tags -f', processUtils, workingDirectory); _runGit('git fetch ${globals.flutterGit} --tags -f', processUtils, workingDirectory);
} }
} }
final List<String> tags = _runGit( final List<String> tags = _runGit(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment