diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index c41d60d2fbb..d6e024917c3 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -13,6 +13,7 @@ import { toGitUri, fromGitUri } from './uri'; import { grep } from './util'; import { applyLineChanges, intersectDiffWithRange, toLineRanges, invertLineChange } from './staging'; import * as path from 'path'; +import { lstatSync } from 'fs'; import * as os from 'os'; import TelemetryReporter from 'vscode-extension-telemetry'; import * as nls from 'vscode-nls'; @@ -159,6 +160,9 @@ export class CommandCenter { } private async _openResource(resource: Resource, preview?: boolean, preserveFocus?: boolean, preserveSelection?: boolean): Promise { + if (lstatSync(resource.resourceUri.fsPath).isDirectory()) { + return; // it's a submodule. + } const left = this.getLeftResource(resource); const right = this.getRightResource(resource); const title = this.getTitle(resource);