Sfoglia il codice sorgente

Fixes #821 - wrong order of Compare * With cmds

main
Eric Amodio 5 anni fa
parent
commit
71cfcbc7c0
2 ha cambiato i file con 10 aggiunte e 9 eliminazioni
  1. +1
    -0
      CHANGELOG.md
  2. +9
    -9
      src/commands/diffBranchWith.ts

+ 1
- 0
CHANGELOG.md Vedi File

@ -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 Vedi File

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

Caricamento…
Annulla
Salva