diff --git a/src/git/gitProviderService.ts b/src/git/gitProviderService.ts index ef9f6f0..fc8eedf 100644 --- a/src/git/gitProviderService.ts +++ b/src/git/gitProviderService.ts @@ -440,6 +440,11 @@ export class GitProviderService implements Disposable { // Send a notification that the repositories changed queueMicrotask(() => this.fireRepositoriesChanged([], [e.repository])); + } else if (e.changed(RepositoryChange.Opened, RepositoryChangeComparisonMode.Any)) { + this.updateContext(); + + // Send a notification that the repositories changed + queueMicrotask(() => this.fireRepositoriesChanged([e.repository], [])); } if (e.changed(RepositoryChange.Remotes, RepositoryChangeComparisonMode.Any)) { diff --git a/src/git/models/repository.ts b/src/git/models/repository.ts index ebacd42..98a9898 100644 --- a/src/git/models/repository.ts +++ b/src/git/models/repository.ts @@ -81,6 +81,7 @@ export const enum RepositoryChange { Ignores = 101, RemoteProviders = 102, Starred = 103, + Opened = 104, } export const enum RepositoryChangeComparisonMode { @@ -459,7 +460,7 @@ export class Repository implements Disposable { const changed = this._closed !== value; this._closed = value; if (changed) { - this.fireChange(RepositoryChange.Closed); + this.fireChange(this._closed ? RepositoryChange.Closed : RepositoryChange.Opened); } } diff --git a/src/views/nodes/repositoryNode.ts b/src/views/nodes/repositoryNode.ts index 65dbcf2..19100a2 100644 --- a/src/views/nodes/repositoryNode.ts +++ b/src/views/nodes/repositoryNode.ts @@ -459,6 +459,7 @@ export class RepositoryNode extends SubscribeableViewNode RepositoryChange.Config, RepositoryChange.Index, RepositoryChange.Heads, + RepositoryChange.Opened, RepositoryChange.Status, RepositoryChange.Unknown, RepositoryChangeComparisonMode.Any, diff --git a/src/views/nodes/viewNode.ts b/src/views/nodes/viewNode.ts index a4313e1..ca36a4f 100644 --- a/src/views/nodes/viewNode.ts +++ b/src/views/nodes/viewNode.ts @@ -677,7 +677,10 @@ export abstract class RepositoryFolderNode< return; } - if (e.changed(RepositoryChange.Starred, RepositoryChangeComparisonMode.Any)) { + if ( + e.changed(RepositoryChange.Opened, RepositoryChangeComparisonMode.Any) || + e.changed(RepositoryChange.Starred, RepositoryChangeComparisonMode.Any) + ) { void this.parent?.triggerChange(true); return;