From ad53c0bf4f29dd2b9748660de440ffda6742ae08 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Sun, 2 Nov 2025 10:52:30 -0800 Subject: [PATCH] Fix Windows CI: use forward slashes in git hook shell scripts Root cause: getBDCommand() returned .\bd.exe on Windows, but git hooks run with sh on Git for Windows where backslashes are escape characters. This caused .\bd.exe to become .bd.exe, breaking hook execution. Fix: Always use forward-slash paths (./bd.exe) in shell scripts. Forward slashes work on Windows and are sh-compatible. --- beads_hash_multiclone_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/beads_hash_multiclone_test.go b/beads_hash_multiclone_test.go index 7f1fb0e5..6af7abee 100644 --- a/beads_hash_multiclone_test.go +++ b/beads_hash_multiclone_test.go @@ -20,9 +20,10 @@ func getBDPath() string { } // getBDCommand returns the platform-specific command to run bd from current dir +// Always uses forward slashes for sh script compatibility (Git for Windows uses sh) func getBDCommand() string { if runtime.GOOS == "windows" { - return ".\\bd.exe" + return "./bd.exe" } return "./bd" } @@ -236,7 +237,8 @@ func resolveConflictMarkersIfPresent(t *testing.T, cloneDir string) { func installGitHooks(t *testing.T, repoDir string) { t.Helper() hooksDir := filepath.Join(repoDir, ".git", "hooks") - bdCmd := getBDCommand() + // Ensure POSIX-style path for sh scripts (even on Windows) + bdCmd := strings.ReplaceAll(getBDCommand(), "\\", "/") preCommit := fmt.Sprintf(`#!/bin/sh %s --no-daemon export -o .beads/issues.jsonl >/dev/null 2>&1 || true