True iff /.codebase-memory/artifact.json contains substr. */
| 736 | |
| 737 | /* True iff <repo>/.codebase-memory/artifact.json contains substr. */ |
| 738 | static bool meta_contains(const char *repo, const char *substr) { |
| 739 | char path[1024]; |
| 740 | snprintf(path, sizeof(path), "%s/.codebase-memory/artifact.json", repo); |
| 741 | FILE *fp = fopen(path, "r"); |
| 742 | if (!fp) { |
| 743 | return false; |
| 744 | } |
| 745 | char buf[4096]; |
| 746 | size_t n = fread(buf, 1, sizeof(buf) - 1, fp); |
| 747 | fclose(fp); |
| 748 | buf[n] = '\0'; |
| 749 | return strstr(buf, substr) != NULL; |
| 750 | } |
| 751 | |
| 752 | static int64_t row_mtime(cbm_file_hash_t *rows, int n, const char *rel) { |
| 753 | for (int i = 0; i < n; i++) { |
no test coverage detected