fix(git-tab): always include branchName in onDefaultBranch responses and auto-refresh on git-changed#254
Merged
plusplusoneplusplus merged 1 commit intoJun 1, 2026
Conversation
…and auto-refresh on git-changed
- Server: when detectCommitRange returns null or throws, call getCurrentBranch()
and include the result as branchName in the { onDefaultBranch: true } response.
This eliminates the hardcoded 'main' fallback on the client when the user is on
any non-default branch.
- Client type (GitDefaultBranchResponse): add optional branchName field.
- Client (RepoGitTab): remove hardcoded 'main' last-resort fallback; use empty
string so the UI shows the real branch or nothing rather than a misleading name.
- Client (WebSocket git-changed handler): clear the client-side branch range cache
and re-fetch branch range alongside commits so branch switches are reflected
immediately without requiring a manual Refresh click.
- Tests: add getCurrentBranch mock to GitRangeService, update assertions in both
git-branch-range-api.test.ts and git-branch-range-edge.test.ts to expect
branchName in onDefaultBranch responses, add new test cases for the two
onDefaultBranch scenarios (null range and git error).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Server: when detectCommitRange returns null or throws, call getCurrentBranch()
and include the result as branchName in the { onDefaultBranch: true } response.
This eliminates the hardcoded 'main' fallback on the client when the user is on
any non-default branch.
Client type (GitDefaultBranchResponse): add optional branchName field.
Client (RepoGitTab): remove hardcoded 'main' last-resort fallback; use empty
string so the UI shows the real branch or nothing rather than a misleading name.
Client (WebSocket git-changed handler): clear the client-side branch range cache
and re-fetch branch range alongside commits so branch switches are reflected
immediately without requiring a manual Refresh click.
Tests: add getCurrentBranch mock to GitRangeService, update assertions in both
git-branch-range-api.test.ts and git-branch-range-edge.test.ts to expect
branchName in onDefaultBranch responses, add new test cases for the two
onDefaultBranch scenarios (null range and git error).
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com