| 249 | } |
| 250 | |
| 251 | void cbm_git_context_free(cbm_git_context_t *ctx) { |
| 252 | if (!ctx) { |
| 253 | return; |
| 254 | } |
| 255 | free(ctx->input_path); |
| 256 | free(ctx->worktree_root); |
| 257 | free(ctx->git_dir); |
| 258 | free(ctx->git_common_dir); |
| 259 | free(ctx->canonical_root); |
| 260 | free(ctx->branch); |
| 261 | free(ctx->branch_slug); |
| 262 | free(ctx->head_sha); |
| 263 | free(ctx->base_sha); |
| 264 | memset(ctx, 0, sizeof(*ctx)); |
| 265 | } |
| 266 | |
| 267 | int cbm_git_context_resolve(const char *path, cbm_git_context_t *out) { |
| 268 | if (!out) { |
no outgoing calls