Skip to content

fix(git-tab): always include branchName in onDefaultBranch responses and auto-refresh on git-changed#254

Merged
plusplusoneplusplus merged 1 commit into
mainfrom
pr/99fe928ea-fixgit-tab-always-include-branchname-in
Jun 1, 2026
Merged

fix(git-tab): always include branchName in onDefaultBranch responses and auto-refresh on git-changed#254
plusplusoneplusplus merged 1 commit into
mainfrom
pr/99fe928ea-fixgit-tab-always-include-branchname-in

Conversation

@plusplusoneplusplus
Copy link
Copy Markdown
Owner

  • 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

…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>
@plusplusoneplusplus plusplusoneplusplus merged commit 4a37b19 into main Jun 1, 2026
34 checks passed
@plusplusoneplusplus plusplusoneplusplus deleted the pr/99fe928ea-fixgit-tab-always-include-branchname-in branch June 1, 2026 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant