When clicking on a changed submodule in the git window, do nothing.

This commit is contained in:
Peter Kahle
2017-10-15 20:46:07 -04:00
parent 472349046b
commit b97bad54b1

View File

@@ -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<void> {
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);