Unverified Commit 1ea72163 authored by Anurag Roy's avatar Anurag Roy Committed by GitHub

[flutter_tools] Remove redundant/unused code in version.dart (#105111)

parent bd133fda
...@@ -273,7 +273,7 @@ class FlutterVersion { ...@@ -273,7 +273,7 @@ class FlutterVersion {
/// ///
/// Throws [VersionCheckError] if a git command fails, for example, when the /// Throws [VersionCheckError] if a git command fails, for example, when the
/// remote git repository is not reachable due to a network issue. /// remote git repository is not reachable due to a network issue.
static Future<String> fetchRemoteFrameworkCommitDate(String branch) async { static Future<String> fetchRemoteFrameworkCommitDate() async {
try { try {
// Fetch upstream branch's commit and tags // Fetch upstream branch's commit and tags
await _run(<String>['git', 'fetch', '--tags']); await _run(<String>['git', 'fetch', '--tags']);
...@@ -360,7 +360,7 @@ class FlutterVersion { ...@@ -360,7 +360,7 @@ class FlutterVersion {
// Cache is empty or it's been a while since the last server ping. Ping the server. // Cache is empty or it's been a while since the last server ping. Ping the server.
try { try {
final DateTime remoteFrameworkCommitDate = DateTime.parse( final DateTime remoteFrameworkCommitDate = DateTime.parse(
await FlutterVersion.fetchRemoteFrameworkCommitDate(channel), await FlutterVersion.fetchRemoteFrameworkCommitDate(),
); );
await versionCheckStamp.store( await versionCheckStamp.store(
newTimeVersionWasChecked: now, newTimeVersionWasChecked: now,
...@@ -926,11 +926,6 @@ class VersionFreshnessValidator { ...@@ -926,11 +926,6 @@ class VersionFreshnessValidator {
/// Execute validations and print warning to [logger] if necessary. /// Execute validations and print warning to [logger] if necessary.
Future<void> run() async { Future<void> run() async {
// Don't perform update checks if we're not on an official channel.
if (!kOfficialChannels.contains(version.channel)) {
return;
}
// Get whether there's a newer version on the remote. This only goes // Get whether there's a newer version on the remote. This only goes
// to the server if we haven't checked recently so won't happen on every // to the server if we haven't checked recently so won't happen on every
// command. // command.
......
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