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

Function branch_resolve_agrees

tests/test_git_context.c:449–460  ·  view source on GitHub ↗

The branch resolver against the full context at `path`; NULL `want` = not git. */

Source from the content-addressed store, hash-verified

447#ifndef _WIN32
448/* The branch resolver against the full context at `path`; NULL `want` = not git. */
449static 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
463TEST(git_branch_resolve_matches_full_context) {

Callers 1

test_git_context.cFile · 0.85

Calls 3

cbm_git_context_resolveFunction · 0.85
cbm_git_branch_resolveFunction · 0.85
cbm_git_context_freeFunction · 0.85

Tested by

no test coverage detected