| 224 | } |
| 225 | |
| 226 | void cbm_git_context_free(cbm_git_context_t *ctx) { |
| 227 | if (!ctx) { |
| 228 | return; |
| 229 | } |
| 230 | free(ctx->input_path); |
| 231 | free(ctx->worktree_root); |
| 232 | free(ctx->git_dir); |
| 233 | free(ctx->git_common_dir); |
| 234 | free(ctx->canonical_root); |
| 235 | free(ctx->branch); |
| 236 | free(ctx->branch_slug); |
| 237 | free(ctx->head_sha); |
| 238 | free(ctx->base_sha); |
| 239 | memset(ctx, 0, sizeof(*ctx)); |
| 240 | } |
| 241 | |
| 242 | int cbm_git_context_resolve(const char *path, cbm_git_context_t *out) { |
| 243 | if (!out) { |
no outgoing calls