MCPcopy Index your code
hub / github.com/codeaashu/claude-code / mergeUntrackedIntoNormalizedCache

Function mergeUntrackedIntoNormalizedCache

src/hooks/fileSuggestions.ts:169–195  ·  view source on GitHub ↗

* Merge already-normalized untracked files into the cache

(
  normalizedUntracked: string[],
)

Source from the content-addressed store, hash-verified

167 * Merge already-normalized untracked files into the cache
168 */
169async 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

Callers 1

getFilesUsingGitFunction · 0.85

Calls 4

getDirectoryNamesAsyncFunction · 0.85
pathListSignatureFunction · 0.85
logForDebuggingFunction · 0.85
loadFromFileListAsyncMethod · 0.80

Tested by

no test coverage detected