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

Function handleAdd

src/utils/settings/changeDetector.ts:308–322  ·  view source on GitHub ↗

* Handle a file being re-added (e.g. after a delete-and-recreate). Cancels any * pending deletion grace timer and treats the event as a change.

(path: string)

Source from the content-addressed store, hash-verified

306 * pending deletion grace timer and treats the event as a change.
307 */
308function handleAdd(path: string): void {
309 const source = getSourceForPath(path)
310 if (!source) return
311
312 // Cancel any pending deletion — the file is back
313 const pendingTimer = pendingDeletions.get(path)
314 if (pendingTimer) {
315 clearTimeout(pendingTimer)
316 pendingDeletions.delete(path)
317 logForDebugging(`Cancelled pending deletion of ${path} — file was re-added`)
318 }
319
320 // Treat as a change (re-read settings)
321 handleChange(path)
322}
323
324/**
325 * Handle a file being deleted. Uses a grace period to absorb delete-and-recreate

Callers

nothing calls this directly

Calls 5

getSourceForPathFunction · 0.85
logForDebuggingFunction · 0.85
handleChangeFunction · 0.70
getMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected