MCPcopy Index your code
hub / github.com/21st-dev/1code / invalidateByPrefix

Method invalidateByPrefix

src/main/lib/git/cache/git-cache.ts:109–119  ·  view source on GitHub ↗

* Invalidate all entries for a given worktree path.

(prefix: string)

Source from the content-addressed store, hash-verified

107 * Invalidate all entries for a given worktree path.
108 */
109 invalidateByPrefix(prefix: string): number {
110 let count = 0;
111 const keys = Array.from(this.cache.keys());
112 for (const key of keys) {
113 if (key.startsWith(prefix)) {
114 this.delete(key);
115 count++;
116 }
117 }
118 return count;
119 }
120
121 /**
122 * Clear all entries.

Callers 3

invalidateParsedDiffMethod · 0.80
invalidateWorktreeMethod · 0.80

Calls 1

deleteMethod · 0.95

Tested by

no test coverage detected