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

Function unwatch_snapshot_callback

tests/test_watcher.c:2862–2874  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2860} unwatch_snapshot_ctx_t;
2861
2862static int unwatch_snapshot_callback(const char *name, const char *path, void *ud) {
2863 (void)name;
2864 (void)path;
2865 unwatch_snapshot_ctx_t *ctx = ud;
2866 ctx->calls++;
2867 if (ctx->calls == 1) {
2868 /* Both states are already present in poll_once's pointer snapshot.
2869 * Removing them must invalidate the not-yet-admitted callback. */
2870 cbm_watcher_unwatch(ctx->watcher, ctx->first_project);
2871 cbm_watcher_unwatch(ctx->watcher, ctx->second_project);
2872 }
2873 return 0;
2874}
2875
2876TEST(watcher_unwatch_invalidates_remaining_poll_snapshot) {
2877 char first[256];

Callers

nothing calls this directly

Calls 1

cbm_watcher_unwatchFunction · 0.85

Tested by

no test coverage detected