Browse Source

Renames DiffHeadWithBranchCommand

main
Eric Amodio 6 years ago
parent
commit
cb15bd6149
3 changed files with 58 additions and 56 deletions
  1. +2
    -2
      src/commands.ts
  2. +9
    -7
      src/commands/diffBranchWithBranch.ts

+ 2
- 2
src/commands.ts View File

@ -8,8 +8,8 @@ export * from './commands/clearFileAnnotations';
export * from './commands/closeUnchangedFiles';
export * from './commands/copyMessageToClipboard';
export * from './commands/copyShaToClipboard';
export * from './commands/diffBranchWithBranch';
export * from './commands/diffDirectory';
export * from './commands/diffHeadWithBranch';
export * from './commands/diffLineWithPrevious';
export * from './commands/diffLineWithWorking';
export * from './commands/diffWith';
@ -59,8 +59,8 @@ export function configureCommands(): void {
Container.context.subscriptions.push(new Commands.ExternalDiffCommand());
Container.context.subscriptions.push(new Commands.CopyMessageToClipboardCommand());
Container.context.subscriptions.push(new Commands.CopyShaToClipboardCommand());
Container.context.subscriptions.push(new Commands.DiffBranchWithBranchCommand());
Container.context.subscriptions.push(new Commands.DiffDirectoryCommand());
Container.context.subscriptions.push(new Commands.DiffHeadWithBranchCommand());
Container.context.subscriptions.push(new Commands.DiffLineWithPreviousCommand());
Container.context.subscriptions.push(new Commands.DiffLineWithWorkingCommand());
Container.context.subscriptions.push(new Commands.DiffWithCommand());

src/commands/diffHeadWithBranch.ts → src/commands/diffBranchWithBranch.ts View File

@ -7,10 +7,10 @@ import { Logger } from '../logger';
import { Messages } from '../messages';
import { BranchesAndTagsQuickPick, CommandQuickPickItem } from '../quickPicks';
export class DiffHeadWithBranchCommand extends ActiveEditorCommand {
export class DiffBranchWithBranchCommand extends ActiveEditorCommand {
constructor() {
super([Commands.DiffHeadWithBranch]);
super(Commands.DiffHeadWithBranch);
}
async execute(editor?: TextEditor, uri?: Uri): Promise<any> {
@ -20,7 +20,7 @@ export class DiffHeadWithBranchCommand extends ActiveEditorCommand {
try {
const repoPath = await Container.git.getRepoPath(uri);
if (!repoPath) return Messages.showNoRepositoryWarningMessage(`Unable to open directory compare`);
if (!repoPath) return Messages.showNoRepositoryWarningMessage(`Unable to open branch compare`);
const placeHolder = `Compare Index (HEAD) to ${GlyphChars.Ellipsis}`;
@ -44,10 +44,12 @@ export class DiffHeadWithBranchCommand extends ActiveEditorCommand {
Container.resultsExplorer.showComparisonInResults(repoPath, compareWith, 'HEAD');
return undefined;
} catch (ex) {
Logger.error(ex, 'DiffHeadWithBranchCommand');
return window.showErrorMessage(`Unable to open directory compare. See output channel for more details`);
} finally {
}
catch (ex) {
Logger.error(ex, 'DiffBranchWithBranchCommand');
return window.showErrorMessage(`Unable to open branch compare. See output channel for more details`);
}
finally {
progressCancellation && progressCancellation.dispose();
}
}

Loading…
Cancel
Save