diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index 2284e266bf7..f35b73486fb 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -5,7 +5,7 @@ 'use strict'; -import { Uri, commands, Disposable, window, workspace, QuickPickItem, OutputChannel, Range, WorkspaceEdit, Position, LineChange, SourceControlResourceState, TextDocumentShowOptions, ViewColumn, ProgressLocation, TextEditor, CancellationTokenSource, StatusBarAlignment } from 'vscode'; +import { Uri, commands, Disposable, window, workspace, QuickPickItem, OutputChannel, Range, WorkspaceEdit, Position, LineChange, SourceControlResourceState, TextDocumentShowOptions, ViewColumn, ProgressLocation, TextEditor, CancellationTokenSource, StatusBarAlignment, MessageOptions } from 'vscode'; import { Ref, RefType, Git, GitErrorCodes, Branch } from './git'; import { Repository, Resource, Status, CommitOptions, ResourceGroupType } from './repository'; import { Model } from './model'; @@ -1635,6 +1635,10 @@ export class CommandCenter { this.telemetryReporter.sendTelemetryEvent('git.command', { command: id }); return result.catch(async err => { + const options: MessageOptions = { + modal: err.gitErrorCode === GitErrorCodes.DirtyWorkTree + }; + let message: string; switch (err.gitErrorCode) { @@ -1664,9 +1668,11 @@ export class CommandCenter { return; } + options.modal = true; + const outputChannel = this.outputChannel as OutputChannel; const openOutputChannelChoice = localize('open git log', "Open Git Log"); - const choice = await window.showErrorMessage(message, openOutputChannelChoice); + const choice = await window.showErrorMessage(message, options, openOutputChannelChoice); if (choice === openOutputChannelChoice) { outputChannel.show();