Fix version command for certain git workflows (#52062)

This commit is contained in:
Dan Field
2020-03-05 23:51:02 -08:00
committed by GitHub
parent 4d05ed5deb
commit 20bf43b9eb
4 changed files with 50 additions and 3 deletions

View File

@@ -23,6 +23,9 @@ enum Channel {
stable,
}
/// The flutter GitHub repository.
const String _flutterGit = 'https://github.com/flutter/flutter.git';
/// Retrieve a human-readable name for a given [channel].
///
/// Requires [FlutterVersion.officialChannels] to be correctly ordered.
@@ -233,7 +236,7 @@ class FlutterVersion {
'remote',
'add',
_versionCheckRemote,
'https://github.com/flutter/flutter.git',
_flutterGit,
]);
await _run(<String>['git', 'fetch', _versionCheckRemote, branch]);
return _latestGitCommitDate(
@@ -702,6 +705,7 @@ class GitTagVersion {
final String hash;
static GitTagVersion determine(ProcessUtils processUtils, [String workingDirectory]) {
_runGit('git fetch $_flutterGit --tags', processUtils, workingDirectory);
return parse(_runGit('git describe --match v*.*.* --first-parent --long --tags', processUtils, workingDirectory));
}