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

Function commit_baselines

src/watcher/watcher.c:1576–1593  ·  view source on GitHub ↗

After a SUCCESSFUL reindex, commit the baselines OBSERVED AT CHECK TIME — * the state whose reindex just succeeded. A commit/edit landing during the * reindex is deliberately not absorbed: the next poll sees it as a new delta * (at-least-once, never lost). */

Source from the content-addressed store, hash-verified

1574 * reindex is deliberately not absorbed: the next poll sees it as a new delta
1575 * (at-least-once, never lost). */
1576static void commit_baselines(cbm_watcher_t *w, project_state_t *s) {
1577 if (!s->is_git) {
1578 /* Tree strategy (#1948): the walk already refreshed the file count. */
1579 s->last_tree_sig = s->pending_tree_sig;
1580 return;
1581 }
1582 if (s->pending_head[0] != '\0') {
1583 snprintf(s->last_head, sizeof(s->last_head), "%s", s->pending_head);
1584 }
1585 s->last_dirty_sig = s->pending_dirty_sig;
1586 /* Refresh file count for interval */
1587 int file_count = 0;
1588 if (git_file_count(w, s, &file_count) == WATCHER_GIT_OK) {
1589 s->file_count = file_count;
1590 s->interval_ms = cbm_watcher_poll_interval_ms(s->file_count);
1591 publish_status(s, false);
1592 }
1593}
1594
1595static void poll_project(const char *key, void *val, void *ud) {
1596 (void)key;

Callers 1

poll_projectFunction · 0.85

Calls 3

git_file_countFunction · 0.85
publish_statusFunction · 0.85

Tested by

no test coverage detected