fix: edge case in normalizeBeadsRelPath for similar prefixes
Code review caught that ".beads" would incorrectly match prefixes like ".beads-backup". Changed to match ".beads/" (with trailing slash) to ensure we only match the actual .beads directory. Added test cases for this edge case. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -218,6 +218,16 @@ func TestNormalizeBeadsRelPath(t *testing.T) {
|
||||
input: ".beads/subdir/file.jsonl",
|
||||
expected: ".beads/subdir/file.jsonl",
|
||||
},
|
||||
{
|
||||
name: "similar prefix like .beads-backup not matched",
|
||||
input: "foo/.beads-backup/.beads/issues.jsonl",
|
||||
expected: ".beads/issues.jsonl",
|
||||
},
|
||||
{
|
||||
name: "only .beads-backup no real .beads unchanged",
|
||||
input: "foo/.beads-backup/file.txt",
|
||||
expected: "foo/.beads-backup/file.txt",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
|
||||
Reference in New Issue
Block a user