From b97bad54b16af593ec1e50086ba99f6ad6bcdfd8 Mon Sep 17 00:00:00 2001 From: Peter Kahle Date: Sun, 15 Oct 2017 20:46:07 -0400 Subject: [PATCH] When clicking on a changed submodule in the git window, do nothing. --- extensions/git/src/commands.ts | 4 ++++ 1 file changed, 4 insertions(+) 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);