From d2d520f5e01fb8d25e3f8d3fab09f9ea89d225c9 Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Tue, 7 Feb 2023 13:41:14 -0500 Subject: [PATCH] Update release tooling to give a workaround for predictable failing case https://github.com/flutter/flutter/issues/120116 (#7111) --- script/tool/lib/src/update_release_info_command.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/script/tool/lib/src/update_release_info_command.dart b/script/tool/lib/src/update_release_info_command.dart index 8d7ceb84d3..240ae72eed 100644 --- a/script/tool/lib/src/update_release_info_command.dart +++ b/script/tool/lib/src/update_release_info_command.dart @@ -107,6 +107,10 @@ class UpdateReleaseInfoCommand extends PackageLoopingCommand { break; case _versionMinimal: final GitVersionFinder gitVersionFinder = await retrieveVersionFinder(); + // If the line below fails with "Not a valid object name FETCH_HEAD" + // run "git fetch", FETCH_HEAD is a temporary reference that only exists + // after a fetch. This can happen when a branch is made locally and + // pushed but never fetched. _changedFiles = await gitVersionFinder.getChangedFiles(); // Anothing other than a fixed change is null. _versionChange = null;