Skip to content

Commit f057da3

Browse files
author
zhaotian1
committed
fix: normalize path separators in VCS watcher .git filter
The session VCS refresh listener uses startsWith('.git/') to skip .git-internal watcher events, but on Windows the raw watcher path may contain backslashes, allowing .git changes to slip through. Use replace() to normalise separators before the prefix check. Related: #41704
1 parent 4a38b61 commit f057da3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/app/src/pages/session.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ export default function Page() {
957957
? (details.properties as Record<string, unknown>)
958958
: undefined
959959
const file = typeof props?.file === "string" ? props.file : undefined
960-
if (!file || file.startsWith(".git/")) return
960+
if (!file || file.replace(/\\/g, "/").startsWith(".git/")) return
961961
refreshVcs()
962962
})
963963
onCleanup(stopVcs)

0 commit comments

Comments
 (0)