Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion .ci/scripts/prepare_tool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
# found in the LICENSE file.
set -e

# To set FETCH_HEAD for "git merge-base" to work
# Ensure that 'main' is present for diffing.
git fetch origin main
git branch main origin/main

cd script/tool
dart pub get
2 changes: 1 addition & 1 deletion script/tool/lib/src/common/git_version_finder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class GitVersionFinder {
: assert(baseSha == null || baseBranch == null,
'At most one of baseSha and baseBranch can be provided'),
_baseSha = baseSha,
_baseBranch = baseBranch ?? 'FETCH_HEAD';
_baseBranch = baseBranch ?? 'main';

/// The top level directory of the git repo.
///
Expand Down
2 changes: 1 addition & 1 deletion script/tool/lib/src/common/package_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ abstract class PackageCommand extends Command<void> {
argParser.addOption(_baseBranchArg,
help: 'The base branch whose merge base is used as the base SHA if '
'--$_baseShaArg is not provided. \n'
'If not specified, FETCH_HEAD is used as the base branch.');
'If not specified, "main" is used as the base branch.');
argParser.addFlag(_logTimingArg,
help: 'Logs timing information.\n\n'
'Currently only logs per-package timing for multi-package commands, '
Expand Down
2 changes: 1 addition & 1 deletion script/tool/test/common/git_version_finder_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ file2/file2.cc
final GitVersionFinder finder = GitVersionFinder(gitDir);
await finder.getChangedFiles();
verify(gitDir.runCommand(
<String>['merge-base', '--fork-point', 'FETCH_HEAD', 'HEAD'],
<String>['merge-base', '--fork-point', 'main', 'HEAD'],
throwOnError: false));
verify(gitDir.runCommand(
<String>['diff', '--name-only', mergeBaseResponse, 'HEAD']));
Expand Down
2 changes: 1 addition & 1 deletion script/tool/test/version_check_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ void main() {
gitProcessRunner.recordedCalls,
containsAllInOrder(const <ProcessCall>[
ProcessCall('git-merge-base',
<String>['--fork-point', 'FETCH_HEAD', 'HEAD'], null),
<String>['--fork-point', 'main', 'HEAD'], null),
ProcessCall('git-show',
<String>['abc123:packages/plugin/pubspec.yaml'], null),
]));
Expand Down