Files
beads/cmd/bd
Charles P. Cross c9dc0276aa Fix daemon sync branch commit failing with pre-commit hooks
When pre-commit hooks are installed (via "bd hooks install"), daemon auto-sync
to sync branches fails with "git commit failed in worktree: exit status 1".

Root cause:
- gitCommitInWorktree() was missing --no-verify flag
- Pre-commit hook runs "bd sync --flush-only" which fails in worktree context
- Worktree has .beads directory, triggering hook execution
- Hook fails because bd cannot find proper database in worktree path

The fix adds --no-verify to git commit in gitCommitInWorktree(), matching
the existing implementation in internal/syncbranch/worktree.go line 684.

This is correct because:
- Worktree commits are internal to bd sync operations
- Running pre-commit hooks in worktree context is semantically wrong
- The library function already skips hooks for this reason

Includes regression test that:
- Creates a repo with sync branch configured
- Installs a failing pre-commit hook (simulating bd hook behavior)
- Verifies commits succeed because --no-verify bypasses the hook
- Tests multiple consecutive commits to ensure consistent behavior

Tested manually by:
1. Creating issue with "bd create" (triggers mutation event)
2. Verifying daemon logs show successful commit to sync branch
3. Confirming push to remote sync branch completes
2025-12-09 22:17:23 -05:00
..
2025-12-03 16:24:46 -08:00
2025-11-25 19:32:05 -08:00
2025-12-07 20:57:58 +11:00
2025-11-24 21:16:44 -08:00
2025-11-24 11:28:32 -08:00
2025-11-23 17:16:27 -08:00
2025-12-03 16:24:46 -08:00