Replace existence-only stat() probes in git context resolution and watcher baseline initialization with cbm_file_exists().
This removes direct sys/stat dependencies from those files without changing behavior: both paths only needed to know whether the root path exists before attempting git snapshot/command handling.
Validation: make -f Makefile.cbm cbm; CBM_ONLY_SUITE=pipeline,tool_consolidation,mcp ./build/c/test-runner; scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Centralize git command formatting, path validation, null-device selection, first-line capture, and command-size checks for git context and watcher code.
This keeps the current command fallback behavior, makes Windows shell metacharacter handling consistent, replaces a touched watcher strdup path with cbm_strdup, and prepares the next git snapshot/pre-discovery acceleration slice without adding a new default route.
Validation: git diff --check; bash scripts/check-source-safety.sh; make -j8 -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=watcher ./build/c/test-runner; CBM_ONLY_SUITE=pipeline ./build/c/test-runner.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Remove git_context.c's private strdup helper and replace literal command/output buffer sizes with CBM-prefixed constants backed by the repository size constants.
This is a prerequisite cleanup for a future shared git snapshot boundary; it does not change command syntax, dependencies, pipeline routing, stdout/stderr behavior, or default incremental behavior.
Validation: git diff --check; bash scripts/check-source-safety.sh; make -j8 -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=pipeline ./build/c/test-runner (282 passed).
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>