Selaa lähdekoodia

Fixes #2167 rollup diff not working for behind

main
Eric Amodio 2 vuotta sitten
vanhempi
commit
d7fcfb4c23
3 muutettua tiedostoa jossa 14 lisäystä ja 3 poistoa
  1. +1
    -0
      CHANGELOG.md
  2. +1
    -0
      src/views/nodes/branchTrackingStatusFilesNode.ts
  3. +12
    -3
      src/views/nodes/statusFileNode.ts

+ 1
- 0
CHANGELOG.md Näytä tiedosto

@ -51,6 +51,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Fixed
- Fixes [#2167](https://github.com/gitkraken/vscode-gitlens/issues/2167) - Rollup diff between working tree and fetched remote doesn't show changes
- Fixes [#2166](https://github.com/gitkraken/vscode-gitlens/issues/2166) - Don't always prompt for GitHub authentication on virtual repositories
- Fixes [#2156](https://github.com/gitkraken/vscode-gitlens/issues/2156) - Reduce extension package size
- Fixes [#2136](https://github.com/gitkraken/vscode-gitlens/issues/2136) - Search & Compare quickpick shouldn't select the mode text when opening

+ 1
- 0
src/views/nodes/branchTrackingStatusFilesNode.ts Näytä tiedosto

@ -89,6 +89,7 @@ export class BranchTrackingStatusFilesNode extends ViewNode {
this.repoPath,
files[files.length - 1],
files.map(s => s.commit),
this.direction,
),
);

+ 12
- 3
src/views/nodes/statusFileNode.ts Näytä tiedosto

@ -19,10 +19,18 @@ export class StatusFileNode extends ViewNode implements FileNo
public readonly file: GitFile;
public readonly repoPath: string;
private readonly _direction: 'ahead' | 'behind';
private readonly _hasStagedChanges: boolean;
private readonly _hasUnstagedChanges: boolean;
constructor(view: ViewsWithCommits, parent: ViewNode, repoPath: string, file: GitFile, commits: GitCommit[]) {
constructor(
view: ViewsWithCommits,
parent: ViewNode,
repoPath: string,
file: GitFile,
commits: GitCommit[],
direction: 'ahead' | 'behind' = 'ahead',
) {
let hasStagedChanges = false;
let hasUnstagedChanges = false;
let ref = undefined;
@ -53,6 +61,7 @@ export class StatusFileNode extends ViewNode implements FileNo
this.file = file;
this.commits = commits;
this._direction = direction;
this._hasStagedChanges = hasStagedChanges;
this._hasUnstagedChanges = hasUnstagedChanges;
}
@ -244,11 +253,11 @@ export class StatusFileNode extends ViewNode implements FileNo
};
}
const commit = this.commits[this.commits.length - 1];
const commit = this._direction === 'behind' ? this.commits[0] : this.commits[this.commits.length - 1];
const file = commit.files?.find(f => f.path === this.file.path) ?? this.file;
const commandArgs: DiffWithCommandArgs = {
lhs: {
sha: `${commit.sha}^`,
sha: this._direction === 'behind' ? commit.sha : `${commit.sha}^`,
uri: GitUri.fromFile(file, this.repoPath, undefined, true),
},
rhs: {

Ladataan…
Peruuta
Tallenna