diff --git a/src/shared/git-worktree/format-file-changes.ts b/src/shared/git-worktree/format-file-changes.ts index 8a23dabf8..ef2a35f73 100644 --- a/src/shared/git-worktree/format-file-changes.ts +++ b/src/shared/git-worktree/format-file-changes.ts @@ -41,7 +41,7 @@ export function formatFileChanges(stats: GitFileStat[], notepadPath?: string): s const normalizedNotepadPath = normalizePath(notepadPath) const notepadStat = stats.find((s) => { const normalizedPath = normalizePath(s.path) - return normalizedPath === normalizedNotepadPath || normalizedPath.includes(".omo/notepads/") + return normalizedPath === normalizedNotepadPath }) if (notepadStat) { lines.push("[NOTEPAD UPDATED]") diff --git a/src/shared/git-worktree/git-worktree.test.ts b/src/shared/git-worktree/git-worktree.test.ts index 2c903d1dc..2ba125a11 100644 --- a/src/shared/git-worktree/git-worktree.test.ts +++ b/src/shared/git-worktree/git-worktree.test.ts @@ -65,4 +65,12 @@ describe("git-worktree", () => { expect(summary).toContain("[NOTEPAD UPDATED]") expect(summary).toContain(".omo/notepads/work/notes.md") }) + + test("#given notepad path #when formatting another omo notepad change #then does not report active notepad updated", () => { + const summary = formatFileChanges([ + { path: ".omo/notepads/other/notes.md", added: 1, removed: 0, status: "modified" }, + ], ".omo/notepads/work/notes.md") + + expect(summary).not.toContain("[NOTEPAD UPDATED]") + }) })