The branch resolver against the full context at `path`; NULL `want` = not git. */
| 447 | #ifndef _WIN32 |
| 448 | /* The branch resolver against the full context at `path`; NULL `want` = not git. */ |
| 449 | static bool branch_resolve_agrees(const char *path, const char *want) { |
| 450 | cbm_git_context_t ctx = {0}; |
| 451 | (void)cbm_git_context_resolve(path, &ctx); |
| 452 | bool is_git = false; |
| 453 | char branch[CBM_GIT_BRANCH_MAX]; |
| 454 | (void)cbm_git_branch_resolve(path, &is_git, branch, sizeof(branch)); |
| 455 | bool agrees = is_git == ctx.is_git && is_git == (want != NULL) && |
| 456 | (want ? (ctx.branch && strcmp(branch, want) == 0 && strcmp(ctx.branch, want) == 0) |
| 457 | : branch[0] == '\0'); |
| 458 | cbm_git_context_free(&ctx); |
| 459 | return agrees; |
| 460 | } |
| 461 | #endif /* _WIN32 */ |
| 462 | |
| 463 | TEST(git_branch_resolve_matches_full_context) { |
no test coverage detected