fix: Correct git merge driver placeholders from %L/%R to %A/%B
Git merge drivers only support three placeholders: - %O (ancestor/base) - %A (current version) - %B (other branch's version) The code was incorrectly using %L and %R, which don't exist in git, causing them to be passed through literally and breaking JSONL merges. Changes: - Fixed merge driver config in init.go, merge.go, README.md, docs - Added detection in bd doctor with clear error messages - Added auto-fix in bd doctor --fix - Added proactive warning in bd sync before git pull - Added reactive error detection after merge failures - Updated all tests to use correct placeholders Now users get helpful guidance at every step: 1. bd doctor detects the issue 2. bd doctor --fix auto-corrects it 3. bd sync warns before pulling if misconfigured 4. Error messages suggest bd doctor --fix when merge fails 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -627,7 +627,7 @@ func TestInitMergeDriverAutoConfiguration(t *testing.T) {
|
||||
}
|
||||
|
||||
// Pre-configure merge driver manually
|
||||
if err := runCommandInDir(tmpDir, "git", "config", "merge.beads.driver", "bd merge %A %O %L %R"); err != nil {
|
||||
if err := runCommandInDir(tmpDir, "git", "config", "merge.beads.driver", "bd merge %A %O %A %B"); err != nil {
|
||||
t.Fatalf("Failed to set git config: %v", err)
|
||||
}
|
||||
|
||||
@@ -776,7 +776,7 @@ func TestInitMergeDriverAutoConfiguration(t *testing.T) {
|
||||
t.Fatalf("Failed to get merge.beads.driver: %v", err)
|
||||
}
|
||||
driver = strings.TrimSpace(driver)
|
||||
expected := "bd merge %A %O %L %R"
|
||||
expected := "bd merge %A %O %A %B"
|
||||
if driver != expected {
|
||||
t.Errorf("Expected merge.beads.driver to be %q, got %q", expected, driver)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user