|
8 | 8 | import type {ReactNode} from 'react'; |
9 | 9 | import type {Comparison} from 'shared/Comparison'; |
10 | 10 | import type {Place, UIChangedFile, VisualChangedFileStatus} from './UncommittedChanges'; |
| 11 | +import {ChangedFileMode} from './UncommittedChanges'; |
11 | 12 | import type {UseUncommittedSelection} from './partialSelection'; |
12 | 13 | import type {ChangedFileStatus, GeneratedStatus} from './types'; |
13 | 14 |
|
@@ -123,6 +124,9 @@ export function File({ |
123 | 124 | .join('\n\n'); |
124 | 125 |
|
125 | 126 | const openFile = () => { |
| 127 | + if (file.type === ChangedFileMode.Submodule) { |
| 128 | + return; |
| 129 | + } |
126 | 130 | if (file.visualStatus === 'U') { |
127 | 131 | const tool = readAtom(externalMergeToolAtom); |
128 | 132 | if (tool != null) { |
@@ -181,9 +185,9 @@ export function File({ |
181 | 185 | </span> |
182 | 186 | {comparison != null && <FileActions file={file} comparison={comparison} place={place} />} |
183 | 187 | </div> |
184 | | - {place === 'main' && selection?.isExpanded(file.path) && ( |
185 | | - <MaybePartialSelection file={file} /> |
186 | | - )} |
| 188 | + {place === 'main' && |
| 189 | + selection?.isExpanded(file.path) && |
| 190 | + file.type !== ChangedFileMode.Submodule && <MaybePartialSelection file={file} />} |
187 | 191 | </> |
188 | 192 | ); |
189 | 193 | } |
@@ -211,7 +215,12 @@ function FileActions({ |
211 | 215 |
|
212 | 216 | const actions: Array<React.ReactNode> = []; |
213 | 217 |
|
214 | | - if (platform.openDiff != null && !conflictStatuses.has(file.status)) { |
| 218 | + if ( |
| 219 | + platform.openDiff != null && |
| 220 | + !conflictStatuses.has(file.status) && |
| 221 | + // Disable for now until vscode.diff no longer attempts to open paths as files for uncommitted submodule changes |
| 222 | + file.type !== ChangedFileMode.Submodule |
| 223 | + ) { |
215 | 224 | actions.push( |
216 | 225 | <Tooltip title={t('Open diff view')} key="open-diff-view" delayMs={1000}> |
217 | 226 | <Button |
@@ -418,7 +427,7 @@ function FileActions({ |
418 | 427 | } |
419 | 428 | } |
420 | 429 |
|
421 | | - if (place === 'main' && conflicts == null) { |
| 430 | + if (place === 'main' && conflicts == null && file.type !== ChangedFileMode.Submodule) { |
422 | 431 | actions.push(<PartialSelectionAction file={file} key="partial-selection" />); |
423 | 432 | } |
424 | 433 | } |
|
0 commit comments