* Merge already-normalized untracked files into the cache
( normalizedUntracked: string[], )
| 167 | * Merge already-normalized untracked files into the cache |
| 168 | */ |
| 169 | async function mergeUntrackedIntoNormalizedCache( |
| 170 | normalizedUntracked: string[], |
| 171 | ): Promise<void> { |
| 172 | if (normalizedUntracked.length === 0) return |
| 173 | if (!fileIndex || cachedTrackedFiles.length === 0) return |
| 174 | |
| 175 | const untrackedDirs = await getDirectoryNamesAsync(normalizedUntracked) |
| 176 | const allPaths = [ |
| 177 | ...cachedTrackedFiles, |
| 178 | ...cachedConfigFiles, |
| 179 | ...cachedTrackedDirs, |
| 180 | ...normalizedUntracked, |
| 181 | ...untrackedDirs, |
| 182 | ] |
| 183 | const sig = pathListSignature(allPaths) |
| 184 | if (sig === loadedMergedSignature) { |
| 185 | logForDebugging( |
| 186 | `[FileIndex] skipped index rebuild — merged paths unchanged`, |
| 187 | ) |
| 188 | return |
| 189 | } |
| 190 | await fileIndex.loadFromFileListAsync(allPaths).done |
| 191 | loadedMergedSignature = sig |
| 192 | logForDebugging( |
| 193 | `[FileIndex] rebuilt index with ${cachedTrackedFiles.length} tracked + ${normalizedUntracked.length} untracked files`, |
| 194 | ) |
| 195 | } |
| 196 | |
| 197 | /** |
| 198 | * Load ripgrep-specific ignore patterns from .ignore or .rgignore files |
no test coverage detected