| 234 | } |
| 235 | |
| 236 | void cbm_git_context_free(cbm_git_context_t *ctx) { |
| 237 | if (!ctx) { |
| 238 | return; |
| 239 | } |
| 240 | free(ctx->input_path); |
| 241 | free(ctx->worktree_root); |
| 242 | free(ctx->git_dir); |
| 243 | free(ctx->git_common_dir); |
| 244 | free(ctx->canonical_root); |
| 245 | free(ctx->branch); |
| 246 | free(ctx->branch_slug); |
| 247 | free(ctx->head_sha); |
| 248 | free(ctx->base_sha); |
| 249 | memset(ctx, 0, sizeof(*ctx)); |
| 250 | } |
| 251 | |
| 252 | int cbm_git_context_resolve(const char *path, cbm_git_context_t *out) { |
| 253 | if (!out) { |
no outgoing calls