From bb402700690245cec8b439c62b4fbae9d527c1ea Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Wed, 2 Jun 2021 15:34:28 -0700 Subject: [PATCH] Add more debug output to snippet git failures (#83806) --- dev/snippets/lib/main.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dev/snippets/lib/main.dart b/dev/snippets/lib/main.dart index 7f1729a24d..e8a49cb115 100644 --- a/dev/snippets/lib/main.dart +++ b/dev/snippets/lib/main.dart @@ -23,9 +23,12 @@ const String _kShowDartPad = 'dartpad'; String getChannelName() { final RegExp gitBranchRegexp = RegExp(r'^## (?.*)'); - final ProcessResult gitResult = Process.runSync('git', ['status', '-b', '--porcelain']); + final ProcessResult gitResult = Process.runSync('git', ['status', '-b', '--porcelain'], environment: { + 'GIT_TRACE': '2', + 'GIT_TRACE_SETUP': '2', + }, includeParentEnvironment: true); if (gitResult.exitCode != 0) - throw 'git status exit with non-zero exit code: ${gitResult.exitCode}'; + throw 'git status exit with non-zero exit code: ${gitResult.exitCode}: ${gitResult.stderr}'; final RegExpMatch? gitBranchMatch = gitBranchRegexp.firstMatch( (gitResult.stdout as String).trim().split('\n').first); return gitBranchMatch == null ? '' : gitBranchMatch.namedGroup('branch')!.split('...').first;