From 922b1b512618d96bd5759b1e92f5f4ca5bd5ff49 Mon Sep 17 00:00:00 2001
From: Andre Roelofs
Date: Tue, 31 Mar 2026 21:33:37 +0200
Subject: [PATCH] worktree: Make expanded symlinks be indexed by default
(#51382)
Closes #41887
This is a stable subset of other efforts to make symlink flows more
intuitive like #46344
Release Notes:
- Fixed expanded symlinks not being searchable
---
crates/worktree/src/worktree.rs | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/crates/worktree/src/worktree.rs b/crates/worktree/src/worktree.rs
index 6665dfa532be31eedba6e522cafd06945e3b33e4..b08f9aaee016d7047b06bf9ac4a4a1ce2b2d1ad8 100644
--- a/crates/worktree/src/worktree.rs
+++ b/crates/worktree/src/worktree.rs
@@ -2776,7 +2776,7 @@ impl LocalSnapshot {
for entry in self.entries_by_path.cursor::<()>(()) {
if entry.is_file() {
assert_eq!(files.next().unwrap().inode, entry.inode);
- if (!entry.is_ignored && !entry.is_external) || entry.is_always_included {
+ if !entry.is_ignored || entry.is_always_included {
assert_eq!(visible_files.next().unwrap().inode, entry.inode);
}
}
@@ -3455,8 +3455,7 @@ pub struct Entry {
/// symlink.
///
/// We only scan entries outside of the worktree once the symlinked
- /// directory is expanded. External entries are treated like gitignored
- /// entries in that they are not included in searches.
+ /// directory is expanded.
pub is_external: bool,
/// Whether this entry is considered to be a `.env` file.
@@ -3661,8 +3660,7 @@ impl sum_tree::Item for Entry {
type Summary = EntrySummary;
fn summary(&self, _cx: ()) -> Self::Summary {
- let non_ignored_count = if (self.is_ignored || self.is_external) && !self.is_always_included
- {
+ let non_ignored_count = if self.is_ignored && !self.is_always_included {
0
} else {
1