Bladeren bron

Fixes #842 - broken compare to working tree

main
Eric Amodio 5 jaren geleden
bovenliggende
commit
2c2741ca20
2 gewijzigde bestanden met toevoegingen van 15 en 8 verwijderingen
  1. +4
    -3
      CHANGELOG.md
  2. +11
    -5
      src/views/nodes/compareResultsNode.ts

+ 4
- 3
CHANGELOG.md Bestand weergeven

@ -50,11 +50,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Fixed
- Fixes [#794](https://github.com/eamodio/vscode-gitlens/issues/794) - Can't get back to settings page easily
- 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 [#842](https://github.com/eamodio/vscode-gitlens/issues/842) - List of changed files in comparison to working tree only shows changed files in comparison to HEAD
- 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 [#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 [#794](https://github.com/eamodio/vscode-gitlens/issues/794) - Can't get back to settings page easily
- Fixes [#738](https://github.com/eamodio/vscode-gitlens/issues/738) - Disable showWhatsNewAfterUpgrades notification
- 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 an issue with branch sorting when the current branch was tree'd
- Fixes an issue with the _Explore Repository from Here_ command in the latest VS Code Insiders

+ 11
- 5
src/views/nodes/compareResultsNode.ts Bestand weergeven

@ -198,7 +198,7 @@ export class CompareResultsNode extends SubscribeableViewNode {
private async getCommitsQuery(maxCount: number | undefined): Promise<CommitsQueryResults> {
const log = await Container.git.getLog(this.uri.repoPath!, {
maxCount: maxCount,
ref: `${this._compareWith.ref || 'HEAD'}${this.comparisonNotation}${this._ref.ref}`
ref: `${this._compareWith.ref || 'HEAD'}${this.comparisonNotation}${this._ref.ref || 'HEAD'}`
});
const count = log !== undefined ? log.count : 0;
@ -211,10 +211,16 @@ export class CompareResultsNode extends SubscribeableViewNode {
}
private async getFilesQuery(): Promise<FilesQueryResults> {
const diff = await Container.git.getDiffStatus(
this.uri.repoPath!,
`${this._compareWith.ref || 'HEAD'}${this.diffComparisonNotation}${this._ref.ref || 'HEAD'}`
);
let comparison;
if (this._compareWith.ref === '') {
comparison = this._ref.ref;
} else if (this._ref.ref === '') {
comparison = this._compareWith.ref;
} else {
comparison = `${this._compareWith.ref}${this.diffComparisonNotation}${this._ref.ref}`;
}
const diff = await Container.git.getDiffStatus(this.uri.repoPath!, comparison);
return {
label: `${Strings.pluralize('file', diff !== undefined ? diff.length : 0, { zero: 'No' })} changed`,

Laden…
Annuleren
Opslaan