#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. */
| 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. */ |
| 9722 | static 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 | |
| 9730 | TEST(tool_index_repository_reuses_existing_project_for_root_issue2134) { |
| 9731 | char repo[CBM_SZ_256]; |