diff --git a/packages/flutter_tools/lib/src/version.dart b/packages/flutter_tools/lib/src/version.dart index 0702b35e7e..e3b66ffd94 100644 --- a/packages/flutter_tools/lib/src/version.dart +++ b/packages/flutter_tools/lib/src/version.dart @@ -689,6 +689,7 @@ class VersionUpstreamValidator { static final List _standardRemotes = [ 'https://github.com/flutter/flutter.git', 'git@github.com:flutter/flutter.git', + 'ssh://git@github.com/flutter/flutter.git', ]; // Strips ".git" suffix from a given string, preferably an url. diff --git a/packages/flutter_tools/test/general.shard/version_test.dart b/packages/flutter_tools/test/general.shard/version_test.dart index ab4c730d44..0d82dedc5b 100644 --- a/packages/flutter_tools/test/general.shard/version_test.dart +++ b/packages/flutter_tools/test/general.shard/version_test.dart @@ -325,6 +325,7 @@ void main() { const String flutterStandardUrlDotGit = 'https://github.com/flutter/flutter.git'; const String flutterNonStandardUrlDotGit = 'https://githubmirror.com/flutter/flutter.git'; const String flutterStandardSshUrlDotGit = 'git@github.com:flutter/flutter.git'; + const String flutterFullSshUrlDotGit = 'ssh://git@github.com/flutter/flutter.git'; VersionCheckError? runUpstreamValidator({ String? versionUpstreamUrl, @@ -394,6 +395,10 @@ void main() { expect(runUpstreamValidator(versionUpstreamUrl: flutterStandardSshUrlDotGit), isNull); }); + testWithoutContext('does not return error at full ssh url with FLUTTER_GIT_URL unset', () { + expect(runUpstreamValidator(versionUpstreamUrl: flutterFullSshUrlDotGit), isNull); + }); + testWithoutContext('stripDotGit removes ".git" suffix if any', () { expect(VersionUpstreamValidator.stripDotGit('https://github.com/flutter/flutter.git'), 'https://github.com/flutter/flutter'); expect(VersionUpstreamValidator.stripDotGit('https://github.com/flutter/flutter'), 'https://github.com/flutter/flutter');