Repository navigation
Fix main: restore getGitCommonDir import and pass a GitRepo to refreshRemoteBranches - #7132
Merged
Merged
Conversation
…hRemoteBranches #7074 and #7100 merged minutes apart and each passed CI alone. #7074 added getGitCommonDir calls in branch-options.ts and a fetchRemoteBranches RPC in the Git plugin that passes a path to refreshRemoteBranches. #7100 dropped the getGitCommonDir import and changed refreshRemoteBranches to take a GitRepo. Restore the import, and have the Git plugin resolve the repo with readGitRepo first, skipping non-repos, as the daemon caller does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
Main is red at 87a6e85. #7074 (b9ea287) and #7100 (87a6e85) merged minutes apart, and each passed CI on its own base:
getGitCommonDircalls topackages/environment-provider-host/src/branch-options.ts. It also added the Git plugin'sfetchRemoteBranchesRPC, which callsrefreshRemoteBranches(path, …).getGitCommonDirimport frombranch-options.tsand changedrefreshRemoteBranchesto take aGitRepoinstead of a path.On main this gives:
Lint and typecheck:src/branch-options.ts(191,27): error TS2304: Cannot find name 'getGitCommonDir'.ReferenceError: getGitCommonDir is not definedinpackages-other,packages-host,plugins-2andintegration(Linux and Windows).Once the import is back, the Git plugin's
fetches remote branches when asked, never on a branch readtest still fails. The plugin passes a path string whererefreshRemoteBranchesnow readsrepo.commonDir, so no fetch ever starts. Opening a merge-base picker would not fetch remotes.Change
branch-options.ts: importgetGitCommonDiragain.plugins/git/host.ts:fetchRemoteBranchesresolves the repo withreadGitRepoand skips non-repos, the same way the daemon'shost.inspect_git_sourcecaller does after Read each git repo fact once per inspect call and check dirtiness with -unormal #7100. It then callsrefreshRemoteBranches(repo, …).Verification
Against origin/main 87a6e85 plus this change:
turbo run typecheckforbb-environment-provider-host,bb-plugin-bb--gitand@bb/host-daemonpasses.bb-environment-provider-hosttests: 48/48 pass, includingbranch-options-cache.test.ts, which failed on main.bb-plugin-bb--gittests: 278/278 pass.host.test.ts > fetches remote branches when askedfails on main and fails with the import fix alone. It passes with this change, and also passed at b9ea287.@bb/host-daemontest/command/host-branches-dispatch.test.ts: 21/21 pass. Several failed on main.tests/integrationfake/smoke/environment-actions.test.ts: 5/5 pass. It failed on main.🤖 Generated with Claude Code