Skip to content

Commit ca70c67

Browse files
authored
Fix Windows repo file watcher using RelativePattern (#1905)
* Fix Windows repo file watcher using Relative Pattern * Fix pattern to get to original
1 parent 9d5b706 commit ca70c67

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

extension/src/repository/data/index.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { join } from 'path'
2-
import { Event, EventEmitter } from 'vscode'
2+
import { Event, EventEmitter, RelativePattern } from 'vscode'
33
import { AvailableCommands, InternalCommands } from '../../commands/internal'
44
import { DiffOutput, ListOutput, StatusOutput } from '../../cli/reader'
55
import { isAnyDvcYaml } from '../../fileSystem'
@@ -141,12 +141,15 @@ export class RepositoryData extends DeferredDisposable {
141141
const gitRoot = await getGitRepositoryRoot(this.dvcRoot)
142142

143143
this.dispose.track(
144-
createFileSystemWatcher(join(this.dvcRoot, '**'), (path: string) => {
145-
if (isExcluded(this.dvcRoot, path)) {
146-
return
144+
createFileSystemWatcher(
145+
new RelativePattern(this.dvcRoot, '**'),
146+
(path: string) => {
147+
if (isExcluded(this.dvcRoot, path)) {
148+
return
149+
}
150+
return this.managedUpdate(path)
147151
}
148-
return this.managedUpdate(path)
149-
})
152+
)
150153
)
151154

152155
this.dispose.track(

0 commit comments

Comments
 (0)