From eae77804fe7c407559336142c9e169244744da50 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Thu, 4 Jun 2020 13:54:32 -0700 Subject: [PATCH] [flutter_tools] use -f when fetching tags (#58703) use -f to overwrite local tags on master branch --- packages/flutter_tools/lib/src/version.dart | 2 +- packages/flutter_tools/test/general.shard/version_test.dart | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/flutter_tools/lib/src/version.dart b/packages/flutter_tools/lib/src/version.dart index 75b186ef03..e798a36e43 100644 --- a/packages/flutter_tools/lib/src/version.dart +++ b/packages/flutter_tools/lib/src/version.dart @@ -749,7 +749,7 @@ class GitTagVersion { if (channel == 'dev' || channel == 'beta' || channel == 'stable') { globals.printTrace('Skipping request to fetchTags - on well known channel $channel.'); } else { - _runGit('git fetch $_flutterGit --tags', processUtils, workingDirectory); + _runGit('git fetch $_flutterGit --tags -f', processUtils, workingDirectory); } } final List tags = _runGit( diff --git a/packages/flutter_tools/test/general.shard/version_test.dart b/packages/flutter_tools/test/general.shard/version_test.dart index 6d7fa7f31a..1cd95cad04 100644 --- a/packages/flutter_tools/test/general.shard/version_test.dart +++ b/packages/flutter_tools/test/general.shard/version_test.dart @@ -573,7 +573,7 @@ void main() { environment: anyNamed('environment'), )).thenReturn(RunResult(ProcessResult(108, 0, 'master', ''), ['git', 'fetch'])); when(processUtils.runSync( - ['git', 'fetch', 'https://github.com/flutter/flutter.git', '--tags'], + ['git', 'fetch', 'https://github.com/flutter/flutter.git', '--tags', '-f'], workingDirectory: anyNamed('workingDirectory'), environment: anyNamed('environment'), )).thenReturn(RunResult(ProcessResult(109, 0, '', ''), ['git', 'fetch'])); @@ -599,7 +599,7 @@ void main() { environment: anyNamed('environment'), )).called(1); verify(processUtils.runSync( - ['git', 'fetch', 'https://github.com/flutter/flutter.git', '--tags'], + ['git', 'fetch', 'https://github.com/flutter/flutter.git', '--tags', '-f'], workingDirectory: anyNamed('workingDirectory'), environment: anyNamed('environment'), )).called(1);