beads/internal/git
Jaron Lochner bd1709321e
fix: skip sync when source and destination JSONL paths are identical (#1367)
Fixes #1298

When sync-branch is configured, findJSONLPath() returns the worktree path
due to GH#1103. This causes CommitToSyncBranch to receive a jsonlPath that
is already inside the worktree, making the sync attempt to copy the file
to itself:

- srcPath = repo/.git/beads-worktrees/sync/.beads/issues.jsonl
- dstPath = repo/.git/beads-worktrees/sync/.beads/issues.jsonl

Since srcPath == dstPath, the file was being copied to itself, resulting
in no changes detected and "No changes to commit" even when there were
uncommitted modifications in the worktree.

The fix adds an early return in SyncJSONLToWorktreeWithOptions when the
source and destination paths are identical, since the file is already
in place and no sync is needed.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 12:39:52 -08:00
..
gitdir.go feat(hooks): add jujutsu (jj) version control support 2026-01-20 19:13:02 -08:00
jujutsu_test.go feat(hooks): add jujutsu (jj) version control support 2026-01-20 19:13:02 -08:00
worktree.go fix: skip sync when source and destination JSONL paths are identical (#1367) 2026-01-27 12:39:52 -08:00
worktree_test.go fix: skip sync when source and destination JSONL paths are identical (#1367) 2026-01-27 12:39:52 -08:00