Skip to content

Commit 3ed753d

Browse files
committed
Trigger Git state updates when new repositories are opened
1 parent 6d83772 commit 3ed753d

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

packages/vscode/src/view/backend/view-provider.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,19 @@ export class ViewProvider implements vscode.WebviewViewProvider {
552552
this.context.subscriptions
553553
)
554554
}
555-
update_git_state()
555+
556+
git.onDidOpenRepository(
557+
(repo: any) => {
558+
repo.state.onDidChange(
559+
update_git_state,
560+
this,
561+
this.context.subscriptions
562+
)
563+
update_git_state()
564+
},
565+
this,
566+
this.context.subscriptions
567+
)
556568
} catch (error) {
557569
console.warn(
558570
`Failed to initialize git watcher, will retry in 1s. Error: ${error}`

0 commit comments

Comments
 (0)