Skip to content

Commit 1f24a33

Browse files
committed
Fixes #3518 only "promote" open worktrees
1 parent 751522a commit 1f24a33

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
1313
### Fixed
1414

1515
- Fixes [#3514](https://github.com/gitkraken/vscode-gitlens/issues/3514) - Attempting to delete the main worktree's branch causes a invalid prompt to delete the main worktree
16+
- Fixes [#3518](https://github.com/gitkraken/vscode-gitlens/issues/3518) - Branches in worktrees are no longer collapsed into folder groupings
1617

1718
## [15.4.0] - 2024-09-04
1819

src/views/nodes/branchNode.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { getWorktreeBranchIconPath } from '../../git/utils/worktree-utils';
1717
import { getContext } from '../../system/context';
1818
import { gate } from '../../system/decorators/gate';
1919
import { log } from '../../system/decorators/log';
20+
import { memoize } from '../../system/decorators/memoize';
2021
import { map } from '../../system/iterable';
2122
import type { Deferred } from '../../system/promise';
2223
import { defer, getSettledValue } from '../../system/promise';
@@ -107,7 +108,7 @@ export class BranchNode
107108
}
108109

109110
private get avoidCompacting(): boolean {
110-
return this.root || this.current || this.worktree != null || this.branch.detached || this.branch.starred;
111+
return this.root || this.current || this.worktree?.opened || this.branch.detached || this.branch.starred;
111112
}
112113

113114
compacted: boolean = false;
@@ -135,6 +136,7 @@ export class BranchNode
135136
return this.avoidCompacting ? [this.branch.name] : this.branch.getNameWithoutRemote().split('/');
136137
}
137138

139+
@memoize()
138140
get worktree(): GitWorktree | undefined {
139141
const worktree = this.context.worktreesByBranch?.get(this.branch.id);
140142
return worktree?.main ? undefined : worktree;

0 commit comments

Comments
 (0)