Skip to content

Commit 7792c61

Browse files
authored
Update gitignore decorations when .git/info/exclude file is edited (#106270)
* detect local `exclude` file edits * use `uri.path` to detect exclude file edits `uri.path` uses forward slash as a path separator indepentent of the host system, which makes it easier to use with regex
1 parent d2da7e9 commit 7792c61

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

extensions/git/src/decorationProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class GitIgnoreDecorationProvider implements DecorationProvider {
2121

2222
constructor(private model: Model) {
2323
this.onDidChangeDecorations = fireEvent(anyEvent<any>(
24-
filterEvent(workspace.onDidSaveTextDocument, e => e.fileName.endsWith('.gitignore')),
24+
filterEvent(workspace.onDidSaveTextDocument, e => /\.gitignore$|\.git\/info\/exclude$/.test(e.uri.path)),
2525
model.onDidOpenRepository,
2626
model.onDidCloseRepository
2727
));

0 commit comments

Comments
 (0)