Skip to content

Commit 27f6837

Browse files
committed
Fixes worktree find/reveal
1 parent 7f84f14 commit 27f6837

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/views/repositoriesView.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,13 +507,13 @@ export class RepositoriesView extends ViewBase<'repositories', RepositoriesNode,
507507
const { repoPath, uri } = worktree;
508508
const url = uri.toString();
509509

510-
return this.findNode(n => n instanceof WorktreeNode && worktree.uri.toString() === url, {
510+
return this.findNode(n => n instanceof WorktreeNode && n.worktree.uri.toString() === url, {
511511
maxDepth: 2,
512512
canTraverse: n => {
513513
// Only search for worktree nodes in the same repo within WorktreesNode
514514
if (n instanceof RepositoriesNode) return true;
515515

516-
if (n instanceof RepositoryNode || n instanceof WorktreesNode) {
516+
if (n instanceof RepositoryNode || n instanceof WorktreesNode || n instanceof BranchOrTagFolderNode) {
517517
return n.repoPath === repoPath;
518518
}
519519

src/views/worktreesView.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { gate } from '../system/decorators/-webview/gate';
1515
import { RepositoriesSubscribeableNode } from './nodes/abstract/repositoriesSubscribeableNode';
1616
import { RepositoryFolderNode } from './nodes/abstract/repositoryFolderNode';
1717
import type { ViewNode } from './nodes/abstract/viewNode';
18+
import { BranchOrTagFolderNode } from './nodes/branchOrTagFolderNode';
1819
import { WorktreeNode } from './nodes/worktreeNode';
1920
import { WorktreesNode } from './nodes/worktreesNode';
2021
import type { GroupedViewContext, RevealOptions } from './viewBase';
@@ -217,12 +218,12 @@ export class WorktreesView extends ViewBase<'worktrees', WorktreesViewNode, Work
217218
const { repoPath, uri } = worktree;
218219
const url = uri.toString();
219220

220-
return this.findNode(n => n instanceof WorktreeNode && worktree.uri.toString() === url, {
221+
return this.findNode(n => n instanceof WorktreeNode && n.worktree.uri.toString() === url, {
221222
maxDepth: 2,
222223
canTraverse: n => {
223224
if (n instanceof WorktreesViewNode) return true;
224225

225-
if (n instanceof WorktreesRepositoryNode) {
226+
if (n instanceof WorktreesRepositoryNode || n instanceof BranchOrTagFolderNode) {
226227
return n.repoPath === repoPath;
227228
}
228229

0 commit comments

Comments
 (0)