Skip to content

Commit cb15bd6

Browse files
committed
Renames DiffHeadWithBranchCommand
1 parent 78bb6ef commit cb15bd6

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/commands.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export * from './commands/clearFileAnnotations';
88
export * from './commands/closeUnchangedFiles';
99
export * from './commands/copyMessageToClipboard';
1010
export * from './commands/copyShaToClipboard';
11+
export * from './commands/diffBranchWithBranch';
1112
export * from './commands/diffDirectory';
12-
export * from './commands/diffHeadWithBranch';
1313
export * from './commands/diffLineWithPrevious';
1414
export * from './commands/diffLineWithWorking';
1515
export * from './commands/diffWith';
@@ -59,8 +59,8 @@ export function configureCommands(): void {
5959
Container.context.subscriptions.push(new Commands.ExternalDiffCommand());
6060
Container.context.subscriptions.push(new Commands.CopyMessageToClipboardCommand());
6161
Container.context.subscriptions.push(new Commands.CopyShaToClipboardCommand());
62+
Container.context.subscriptions.push(new Commands.DiffBranchWithBranchCommand());
6263
Container.context.subscriptions.push(new Commands.DiffDirectoryCommand());
63-
Container.context.subscriptions.push(new Commands.DiffHeadWithBranchCommand());
6464
Container.context.subscriptions.push(new Commands.DiffLineWithPreviousCommand());
6565
Container.context.subscriptions.push(new Commands.DiffLineWithWorkingCommand());
6666
Container.context.subscriptions.push(new Commands.DiffWithCommand());

src/commands/diffHeadWithBranch.ts renamed to src/commands/diffBranchWithBranch.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import { Logger } from '../logger';
77
import { Messages } from '../messages';
88
import { BranchesAndTagsQuickPick, CommandQuickPickItem } from '../quickPicks';
99

10-
export class DiffHeadWithBranchCommand extends ActiveEditorCommand {
10+
export class DiffBranchWithBranchCommand extends ActiveEditorCommand {
1111

1212
constructor() {
13-
super([Commands.DiffHeadWithBranch]);
13+
super(Commands.DiffHeadWithBranch);
1414
}
1515

1616
async execute(editor?: TextEditor, uri?: Uri): Promise<any> {
@@ -20,7 +20,7 @@ export class DiffHeadWithBranchCommand extends ActiveEditorCommand {
2020

2121
try {
2222
const repoPath = await Container.git.getRepoPath(uri);
23-
if (!repoPath) return Messages.showNoRepositoryWarningMessage(`Unable to open directory compare`);
23+
if (!repoPath) return Messages.showNoRepositoryWarningMessage(`Unable to open branch compare`);
2424

2525
const placeHolder = `Compare Index (HEAD) to ${GlyphChars.Ellipsis}`;
2626

@@ -44,10 +44,12 @@ export class DiffHeadWithBranchCommand extends ActiveEditorCommand {
4444
Container.resultsExplorer.showComparisonInResults(repoPath, compareWith, 'HEAD');
4545

4646
return undefined;
47-
} catch (ex) {
48-
Logger.error(ex, 'DiffHeadWithBranchCommand');
49-
return window.showErrorMessage(`Unable to open directory compare. See output channel for more details`);
50-
} finally {
47+
}
48+
catch (ex) {
49+
Logger.error(ex, 'DiffBranchWithBranchCommand');
50+
return window.showErrorMessage(`Unable to open branch compare. See output channel for more details`);
51+
}
52+
finally {
5153
progressCancellation && progressCancellation.dispose();
5254
}
5355
}

0 commit comments

Comments
 (0)