Skip to content

Commit 4981453

Browse files
authored
Git - fix working tree file system watcher regex (microsoft#182310)
1 parent f47327f commit 4981453

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

extensions/git/src/repository.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ export class Repository implements Disposable {
769769
this.disposables.push(repositoryWatcher);
770770

771771
const onRepositoryFileChange = anyEvent(repositoryWatcher.onDidChange, repositoryWatcher.onDidCreate, repositoryWatcher.onDidDelete);
772-
const onRepositoryWorkingTreeFileChange = filterEvent(onRepositoryFileChange, uri => !/\.git($|\/)/.test(relativePath(repository.root, uri.fsPath)));
772+
const onRepositoryWorkingTreeFileChange = filterEvent(onRepositoryFileChange, uri => !/\.git($|\\|\/)/.test(relativePath(repository.root, uri.fsPath)));
773773

774774
let onRepositoryDotGitFileChange: Event<Uri>;
775775

@@ -780,7 +780,7 @@ export class Repository implements Disposable {
780780
} catch (err) {
781781
logger.error(`Failed to watch path:'${this.dotGit.path}' or commonPath:'${this.dotGit.commonPath}', reverting to legacy API file watched. Some events might be lost.\n${err.stack || err}`);
782782

783-
onRepositoryDotGitFileChange = filterEvent(onRepositoryFileChange, uri => /\.git($|\/)/.test(uri.path));
783+
onRepositoryDotGitFileChange = filterEvent(onRepositoryFileChange, uri => /\.git($|\\|\/)/.test(uri.path));
784784
}
785785

786786
// FS changes should trigger `git status`:

0 commit comments

Comments
 (0)