Prepare for long filenames in Flutter repo (#9888)
diff --git a/tool/lib/commands/update_flutter_sdk.dart b/tool/lib/commands/update_flutter_sdk.dart
index ab11876..73a95f5 100644
--- a/tool/lib/commands/update_flutter_sdk.dart
+++ b/tool/lib/commands/update_flutter_sdk.dart
@@ -86,10 +86,23 @@
     }
 
     // Next, update (or clone) the tool/flutter-sdk copy.
+
+    // On Windows LCUI trybots, some of the flutter repo paths cause
+    // "Filename too long" errors. Filenames such as:
+    //     engine/src/flutter/testing/ios_scenario_app/ios/Scenarios/
+    //     ScenariosUITests/
+    //     golden_platform_view_clippath_with_transform_multiple_clips_impeller_iPhone SE (3rd generation)_26.2_simulator.png'.
+    final gitLongFilesCommand = CliCommand.git([
+      'config',
+      'core.longpaths',
+      'true',
+    ]);
+
     if (Directory(toolSdkPath).existsSync()) {
       log.stdout('Updating Flutter at $toolSdkPath');
       await processManager.runAll(
         commands: [
+          gitLongFilesCommand,
           CliCommand.git(['fetch']),
           CliCommand.git(['checkout', flutterVersion, '-f']),
           CliCommand.flutter(['--version']),
@@ -101,6 +114,7 @@
       await processManager.runProcess(
         CliCommand.git([
           'clone',
+          '--no-checkout',
           'https://github.com/flutter/flutter',
           flutterSdkDirName,
         ]),
@@ -108,6 +122,7 @@
       );
       await processManager.runAll(
         commands: [
+          gitLongFilesCommand,
           CliCommand.git(['checkout', flutterVersion, '-f']),
           CliCommand.flutter(['--version']),
         ],
diff --git a/tool/lib/utils.dart b/tool/lib/utils.dart
index bc8d85a..97e3b59 100644
--- a/tool/lib/utils.dart
+++ b/tool/lib/utils.dart
@@ -163,6 +163,7 @@
     );
   }
 
+  /// Runs [commands] in serial, from [workingDirectory].
   Future<void> runAll({
     required List<CliCommand> commands,
     String? workingDirectory,