MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / i2134_count_occurrences

Function i2134_count_occurrences

tests/test_mcp.c:9722–9728  ·  view source on GitHub ↗

#2134: re-indexing a root WITHOUT `name` must update the project that * already owns that root_path, not fork a second index under the * path-derived name (both then list the same root_path and the stale one * keeps being read as fresh). Several owners of one root are ambiguous: the * call must fail loudly and name them instead of guessing or forking. */

Source from the content-addressed store, hash-verified

9720 * keeps being read as fresh). Several owners of one root are ambiguous: the
9721 * call must fail loudly and name them instead of guessing or forking. */
9722static int i2134_count_occurrences(const char *haystack, const char *needle) {
9723 int count = 0;
9724 for (const char *p = haystack ? strstr(haystack, needle) : NULL; p; p = strstr(p + 1, needle)) {
9725 count++;
9726 }
9727 return count;
9728}
9729
9730TEST(tool_index_repository_reuses_existing_project_for_root_issue2134) {
9731 char repo[CBM_SZ_256];

Callers 1

test_mcp.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected