[go: nahoru, domu]

Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

[tool] Improve main-branch detection #7038

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix throw
  • Loading branch information
stuartmorgan committed Jan 27, 2023
commit e36a4acbdfe167ca4ad1cb9aba3e1e173cd580ee
7 changes: 4 additions & 3 deletions script/tool/lib/src/common/package_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -539,9 +539,10 @@ abstract class PackageCommand extends Command<void> {
// This is used because CI may check out a specific hash rather than a branch,
// in which case branch-name detection won't work.
Future<bool> _isCheckoutFromBranch(String branchName) async {
final ProcessResult = await (await gitDir)
.runCommand(<String>['merge-base', '--is-ancestor', 'HEAD', 'main']);
return ProcessResult.exitCode == 0;
final io.ProcessResult result = await (await gitDir).runCommand(
<String>['merge-base', '--is-ancestor', 'HEAD', branchName],
throwOnError: false);
return result.exitCode == 0;
}

Future<String?> _getBranch() async {
Expand Down