Skip to content

fix: local branches count not updated immediately after creating branch - #2472

Merged
love-linger merged 1 commit into
sourcegit-scm:developfrom
JC-Chung:fix/local-branches-count-not-updated-after-create-branch
Jun 23, 2026
Merged

fix: local branches count not updated immediately after creating branch#2472
love-linger merged 1 commit into
sourcegit-scm:developfrom
JC-Chung:fix/local-branches-count-not-updated-after-create-branch

Conversation

@JC-Chung

Copy link
Copy Markdown
Contributor

After creating a branch, the count next to "LOCAL BRANCHES" in the
sidebar is not updated until the watcher triggers a full refresh.

RefreshAfterCreateBranch calls MarkBranchUpdated() which suppresses
the watcher, but does not update LocalBranchesCount itself.
LocalBranchesCount is only set inside RefreshBranches().

Fix by computing the count from the already-built locals list and
assigning LocalBranchesCount after LocalBranchTrees is updated,
consistent with how RefreshBranches() calculates it.

@JC-Chung
JC-Chung force-pushed the fix/local-branches-count-not-updated-after-create-branch branch from 7118636 to 0e72710 Compare June 23, 2026 09:06
@love-linger love-linger self-assigned this Jun 23, 2026
@love-linger love-linger added the bug Something isn't working label Jun 23, 2026
@love-linger
love-linger merged commit 5a53e56 into sourcegit-scm:develop Jun 23, 2026
8 checks passed
@JC-Chung
JC-Chung deleted the fix/local-branches-count-not-updated-after-create-branch branch June 23, 2026 09:16
love-linger added a commit that referenced this pull request Jun 23, 2026
Count local branches while collecting it

Signed-off-by: leo <longshuang@msn.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

2 participants