@@ -713,15 +713,21 @@ export class RepositoryPanel extends ViewletPanel {
713
713
this . _register ( this . tree . onContextMenu ( this . onListContextMenu , this ) ) ;
714
714
this . _register ( this . tree ) ;
715
715
716
- let mode = this . configurationService . getValue < 'tree' | 'list' > ( 'scm.defaultViewMode' ) === 'list' ? ViewModelMode . List : ViewModelMode . Tree ;
716
+ let mode : ViewModelMode ;
717
717
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 ;
719
724
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 ;
722
727
723
- if ( typeof storageMode === 'string' ) {
724
- mode = storageMode ;
728
+ if ( typeof storageMode === 'string' ) {
729
+ mode = storageMode ;
730
+ }
725
731
}
726
732
}
727
733
@@ -735,8 +741,10 @@ export class RepositoryPanel extends ViewletPanel {
735
741
this . _register ( this . themeService . onDidFileIconThemeChange ( this . updateIndentStyles , this ) ) ;
736
742
this . _register ( this . viewModel . onDidChangeMode ( this . onDidChangeMode , this ) ) ;
737
743
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
+ }
740
748
741
749
this . _register ( this . onDidChangeBodyVisibility ( this . _onDidChangeVisibility , this ) ) ;
742
750
0 commit comments