fix(hooks): skip JSONL sync for Dolt backend
Pre-commit and post-merge git hooks were unconditionally running bd sync/import for JSONL sync, which fails with Dolt backend. Now both hooks check metadata.json for backend type and exit early if Dolt is configured. Dolt uses its own sync mechanism. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -296,6 +296,13 @@ if [ -z "$BEADS_DIR" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Skip for Dolt backend (uses its own sync mechanism, not JSONL)
|
||||
if [ -f "$BEADS_DIR/metadata.json" ]; then
|
||||
if grep -q '"backend"[[:space:]]*:[[:space:]]*"dolt"' "$BEADS_DIR/metadata.json" 2>/dev/null; then
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# Flush pending changes to JSONL
|
||||
if ! bd sync --flush-only >/dev/null 2>&1; then
|
||||
echo "Error: Failed to flush bd changes to JSONL" >&2
|
||||
@@ -392,6 +399,13 @@ if [ -z "$BEADS_DIR" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Skip for Dolt backend (uses its own sync mechanism, not JSONL import)
|
||||
if [ -f "$BEADS_DIR/metadata.json" ]; then
|
||||
if grep -q '"backend"[[:space:]]*:[[:space:]]*"dolt"' "$BEADS_DIR/metadata.json" 2>/dev/null; then
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check if issues.jsonl exists and was updated
|
||||
if [ ! -f "$BEADS_DIR/issues.jsonl" ]; then
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user