Skip to content

Commit 717bcf0

Browse files
committed
hardcode git as the only scm provider with tree support
recovery release only fixes #82203
1 parent 19c1562 commit 717bcf0

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

src/vs/workbench/contrib/scm/browser/repositoryPanel.ts

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -713,15 +713,21 @@ export class RepositoryPanel extends ViewletPanel {
713713
this._register(this.tree.onContextMenu(this.onListContextMenu, this));
714714
this._register(this.tree);
715715

716-
let mode = this.configurationService.getValue<'tree' | 'list'>('scm.defaultViewMode') === 'list' ? ViewModelMode.List : ViewModelMode.Tree;
716+
let mode: ViewModelMode;
717717

718-
const rootUri = this.repository.provider.rootUri;
718+
if (this.repository.provider.contextValue !== 'git') {
719+
mode = ViewModelMode.List;
720+
} else {
721+
mode = this.configurationService.getValue<'tree' | 'list'>('scm.defaultViewMode') === 'list' ? ViewModelMode.List : ViewModelMode.Tree;
722+
723+
const rootUri = this.repository.provider.rootUri;
719724

720-
if (typeof rootUri !== 'undefined') {
721-
const storageMode = this.storageService.get(`scm.repository.viewMode:${rootUri.toString()}`, StorageScope.WORKSPACE) as ViewModelMode;
725+
if (typeof rootUri !== 'undefined') {
726+
const storageMode = this.storageService.get(`scm.repository.viewMode:${rootUri.toString()}`, StorageScope.WORKSPACE) as ViewModelMode;
722727

723-
if (typeof storageMode === 'string') {
724-
mode = storageMode;
728+
if (typeof storageMode === 'string') {
729+
mode = storageMode;
730+
}
725731
}
726732
}
727733

@@ -735,8 +741,10 @@ export class RepositoryPanel extends ViewletPanel {
735741
this._register(this.themeService.onDidFileIconThemeChange(this.updateIndentStyles, this));
736742
this._register(this.viewModel.onDidChangeMode(this.onDidChangeMode, this));
737743

738-
this.toggleViewModelModeAction = new ToggleViewModeAction(this.viewModel);
739-
this._register(this.toggleViewModelModeAction);
744+
if (this.repository.provider.contextValue === 'git') {
745+
this.toggleViewModelModeAction = new ToggleViewModeAction(this.viewModel);
746+
this._register(this.toggleViewModelModeAction);
747+
}
740748

741749
this._register(this.onDidChangeBodyVisibility(this._onDidChangeVisibility, this));
742750

0 commit comments

Comments
 (0)