| 417 | } |
| 418 | |
| 419 | static bool frozen_git_valid(const cbm_git_context_t *git) { |
| 420 | if (!git || !git->is_git || !git->root_exists) |
| 421 | return false; |
| 422 | const char *strings[] = {git->input_path, git->worktree_root, git->git_dir, |
| 423 | git->git_common_dir, git->canonical_root, git->branch, |
| 424 | git->branch_slug}; |
| 425 | for (size_t i = 0; i < sizeof(strings) / sizeof(strings[0]); i++) { |
| 426 | if (!frozen_string(strings[i], i >= 4)) |
| 427 | return false; |
| 428 | } |
| 429 | return frozen_oid(git->head_sha) && frozen_oid(git->base_sha) && |
| 430 | strlen(git->head_sha) == strlen(git->base_sha); |
| 431 | } |
| 432 | |
| 433 | static bool frozen_policy_valid(const cbm_index_resource_policy_t *policy) { |
| 434 | if (policy->max_files.enabled && |
no test coverage detected