Add more debug output to snippet git failures (#83806)
This commit is contained in:
parent
8f866ab5f4
commit
bb40270069
@ -23,9 +23,12 @@ const String _kShowDartPad = 'dartpad';
|
||||
|
||||
String getChannelName() {
|
||||
final RegExp gitBranchRegexp = RegExp(r'^## (?<branch>.*)');
|
||||
final ProcessResult gitResult = Process.runSync('git', <String>['status', '-b', '--porcelain']);
|
||||
final ProcessResult gitResult = Process.runSync('git', <String>['status', '-b', '--porcelain'], environment: <String, String>{
|
||||
'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 ? '<unknown>' : gitBranchMatch.namedGroup('branch')!.split('...').first;
|
||||
|
Loading…
x
Reference in New Issue
Block a user