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

Function check_changes

src/watcher/watcher.c:512–530  ·  view source on GitHub ↗

Check if a project has changes. Returns true if reindex needed. */

Source from the content-addressed store, hash-verified

510
511/* Check if a project has changes. Returns true if reindex needed. */
512static bool check_changes(project_state_t *s) {
513 if (!s->is_git) {
514 return false;
515 }
516
517 /* Check HEAD movement */
518 char head[CBM_SZ_64] = {0};
519 if (git_head(s->root_path, head, sizeof(head)) == 0) {
520 if (s->last_head[0] != '\0' && strcmp(head, s->last_head) != 0) {
521 /* HEAD moved — commit, checkout, pull */
522 strncpy(s->last_head, head, sizeof(s->last_head) - 1);
523 return true;
524 }
525 strncpy(s->last_head, head, sizeof(s->last_head) - 1);
526 }
527
528 /* Check working tree */
529 return git_is_dirty(s->root_path);
530}
531
532/* Context for poll_once foreach callback */
533typedef struct {

Callers 1

poll_projectFunction · 0.85

Calls 2

git_headFunction · 0.85
git_is_dirtyFunction · 0.85

Tested by

no test coverage detected