Defers $TEMP_DIR expansion to execution time and quotes the variable
inside the trap, protecting against paths with spaces.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests git-dir vs git-common-dir comparison in normal repo, linked
worktree, detached HEAD, and cleanup guard scenarios.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>