Skip to content

Commit

Permalink
add handler for file create/add events
Browse files Browse the repository at this point in the history
  • Loading branch information
moloko committed Nov 30, 2021
1 parent 1937706 commit 385d98a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ export function activate(context: vscode.ExtensionContext) {


const pattern = new vscode.RelativePattern(gitpath, "HEAD");
const watcher = vscode.workspace.createFileSystemWatcher(pattern);
const watcher = vscode.workspace.createFileSystemWatcher(pattern, false, false);
watcher.onDidCreate(e => { // workaround for https://github.com/microsoft/vscode/issues/136460
console.log(".git/HEAD create detected");
updateBranch(status, e.fsPath);
});
watcher.onDidChange(e => {
console.log(".git/HEAD change detected");
updateBranch(status, e.fsPath);
Expand Down

0 comments on commit 385d98a

Please sign in to comment.