Skip to content

fix: keep folder filter when checking out or creating a branch inside it - #2778

Merged
love-linger merged 2 commits into
sourcegit-scm:developfrom
hltu1:fix/keep-folder-filter-on-checkout
Oct 13, 2026
Merged

love-linger merged 2 commits into
sourcegit-scm:developfrom
hltu1:fix/keep-folder-filter-on-checkout

Conversation

@hltu1

@hltu1 hltu1 commented Oct 12, 2026

Copy link
Copy Markdown

When the history is filtered with an included branch folder, checking out
(or creating and checking out) a branch inside that folder replaced the
folder filter with a filter for just that branch, because the automatic
include also unsets every parent folder filter.

Skip the automatic include when an ancestor folder filter with the same
mode already covers the branch. Manual include clicks are unchanged.

Co-Authored-By: Claude Sonnet 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01SQ4PfsLku4ovivLiux3cYo

When the history is filtered with an included branch folder, checking out
(or creating and checking out) a branch inside that folder replaced the
folder filter with a filter for just that branch, because the automatic
include also unsets every parent folder filter.

Skip the automatic include when an ancestor folder filter with the same
mode already covers the branch. Manual include clicks are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SQ4PfsLku4ovivLiux3cYo
@love-linger love-linger self-assigned this Oct 13, 2026
@love-linger love-linger added the enhancement New feature or request label Oct 13, 2026
- Check `FilterType` instead of `FilterMode` since we have already checked the `_histroryFilterMode`.
- Simplify `IsCoveredByFolderFilter`

Signed-off-by: leo <longshuang@msn.cn>
@love-linger
love-linger merged commit 0746d0b into sourcegit-scm:develop Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants