浏览代码

Fixes #821 - wrong order of Compare * With cmds

main
Eric Amodio 5 年前
父节点
当前提交
71cfcbc7c0
共有 2 个文件被更改,包括 10 次插入9 次删除
  1. +1
    -0
      CHANGELOG.md
  2. +9
    -9
      src/commands/diffBranchWith.ts

+ 1
- 0
CHANGELOG.md 查看文件

@ -49,6 +49,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Fixed
- Fixes [#821](https://github.com/eamodio/vscode-gitlens/issues/821) - Wrong comparison order in the Compare view when using Compare [HEAD|Working Tree] With comands
- Fixes [#828](https://github.com/eamodio/vscode-gitlens/issues/828) - Version comparison to show welcome message is not future proof — thanks to [PR #829](https://github.com/eamodio/vscode-gitlens/pull/829) by Arunprasad Rajkumar ([@arajkumar](https://github.com/arajkumar))
- Fixes typo of "workbench.colorCustomization" in README — thanks to [PR #823](https://github.com/eamodio/vscode-gitlens/pull/823) by Kwok ([@mankwok](https://github.com/mankwok))
- Fixes [#738](https://github.com/eamodio/vscode-gitlens/issues/738) - Disable showWhatsNewAfterUpgrades notification

+ 9
- 9
src/commands/diffBranchWith.ts 查看文件

@ -34,12 +34,12 @@ export class DiffBranchWithCommand extends ActiveEditorCommand {
switch (context.command) {
case Commands.DiffHeadWith:
case Commands.DiffHeadWithBranch:
args.ref2 = 'HEAD';
args.ref1 = 'HEAD';
break;
case Commands.DiffWorkingWith:
case Commands.DiffWorkingWithBranch:
args.ref2 = '';
args.ref1 = '';
break;
}
@ -47,7 +47,7 @@ export class DiffBranchWithCommand extends ActiveEditorCommand {
}
async execute(editor?: TextEditor, uri?: Uri, args: DiffBranchWithCommandArgs = {}) {
if (args.ref2 === undefined) return undefined;
if (args.ref1 === undefined) return undefined;
uri = getCommandUri(uri, editor);
@ -59,10 +59,10 @@ export class DiffBranchWithCommand extends ActiveEditorCommand {
);
if (!repoPath) return undefined;
if (!args.ref1) {
if (!args.ref2) {
let checkmarks;
let placeHolder;
switch (args.ref2) {
switch (args.ref1) {
case '':
checkmarks = false;
placeHolder = `Compare Working Tree with${GlyphChars.Ellipsis}`;
@ -73,21 +73,21 @@ export class DiffBranchWithCommand extends ActiveEditorCommand {
break;
default:
checkmarks = true;
placeHolder = `Compare ${args.ref2} with${GlyphChars.Ellipsis}`;
placeHolder = `Compare ${args.ref1} with${GlyphChars.Ellipsis}`;
break;
}
const pick = await new ReferencesQuickPick(repoPath).show(placeHolder, {
allowEnteringRefs: true,
checked: args.ref2,
checked: args.ref1,
checkmarks: checkmarks
});
if (pick === undefined) return undefined;
if (pick instanceof CommandQuickPickItem) return pick.execute();
args.ref1 = pick.ref;
if (args.ref1 === undefined) return undefined;
args.ref2 = pick.ref;
if (args.ref2 === undefined) return undefined;
}
await Container.compareView.compare(repoPath, args.ref1, args.ref2);

正在加载...
取消
保存