fix(sync): normalize JSONL path in CommitToSyncBranch for sync-branch mode#1340
Merged
steveyegge merged 1 commit intosteveyegge:mainfrom Jan 27, 2026
Merged
Conversation
… mode When sync-branch is configured, findJSONLPath() returns the worktree path (per GH#1103), causing jsonlRelPath to contain extra path components like ".git/beads-worktrees/beads-sync/.beads/issues.jsonl". This caused two issues in CommitToSyncBranch: 1. hasChangesInWorktree checked the wrong path, always returning "no changes" even when changes existed 2. commitInWorktree tried to git add the wrong path, failing with exit status 128 The fix applies NormalizeBeadsRelPath (which strips path components before .beads/) to get the correct relative path. This matches the fix already present in daemon_sync_branch.go for GH#810. Fixes: bd sync --full not committing/pushing with dolt backend + git-portable mode + sync-branch configuration. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Contributor
Author
|
The lint error is pre-existing, also present on main |
steveyegge
approved these changes
Jan 27, 2026
Owner
steveyegge
left a comment
There was a problem hiding this comment.
LGTM - clean fix applying NormalizeBeadsRelPath() to handle worktree path normalization. Tests pass, lint failure is pre-existing on main (unrelated gosec G304 in migrate_dolt.go).
groblegark
pushed a commit
to groblegark/beads
that referenced
this pull request
Jan 31, 2026
… mode (steveyegge#1340) When sync-branch is configured, findJSONLPath() returns the worktree path (per GH#1103), causing jsonlRelPath to contain extra path components like ".git/beads-worktrees/beads-sync/.beads/issues.jsonl". This caused two issues in CommitToSyncBranch: 1. hasChangesInWorktree checked the wrong path, always returning "no changes" even when changes existed 2. commitInWorktree tried to git add the wrong path, failing with exit status 128 The fix applies NormalizeBeadsRelPath (which strips path components before .beads/) to get the correct relative path. This matches the fix already present in daemon_sync_branch.go for GH#810. Fixes: bd sync --full not committing/pushing with dolt backend + git-portable mode + sync-branch configuration. Co-authored-by: Claude Opus 4.5 <[email protected]>
groblegark
pushed a commit
to groblegark/beads
that referenced
this pull request
Jan 31, 2026
… mode (steveyegge#1340) When sync-branch is configured, findJSONLPath() returns the worktree path (per GH#1103), causing jsonlRelPath to contain extra path components like ".git/beads-worktrees/beads-sync/.beads/issues.jsonl". This caused two issues in CommitToSyncBranch: 1. hasChangesInWorktree checked the wrong path, always returning "no changes" even when changes existed 2. commitInWorktree tried to git add the wrong path, failing with exit status 128 The fix applies NormalizeBeadsRelPath (which strips path components before .beads/) to get the correct relative path. This matches the fix already present in daemon_sync_branch.go for GH#810. Fixes: bd sync --full not committing/pushing with dolt backend + git-portable mode + sync-branch configuration. Co-authored-by: Claude Opus 4.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes
bd sync --fullfailing to commit and push changes when using dolt backend with git-portable mode and sync-branch configured.Root cause: When sync-branch is configured,
findJSONLPath()returns the worktree path (per GH#1103), causingjsonlRelPathinCommitToSyncBranchto contain extra path components (e.g.,.git/beads-worktrees/beads-sync/.beads/issues.jsonl). This led to:hasChangesInWorktreechecking the wrong path and always returning "no changes"commitInWorktreetrying togit addthe wrong path, failing with exit status 128Fix: Apply
NormalizeBeadsRelPathto strip the extra path components before using the path for change detection and committing. This matches the fix already present indaemon_sync_branch.gofor GH#810.Changes
internal/syncbranch/worktree.go: NormalizejsonlRelPathbefore constructingworktreeJSONLPathand passing tocommitInWorktreeTest plan
TestCommitToSyncBranchtests passbd sync --fullon repo with dolt backend + git-portable mode + sync-branch now successfully commits and pushesGenerated with Claude Code