Browse Source

Fixes issue with behind files & compare w/ working

main
Eric Amodio 4 years ago
parent
commit
cb1512bb4c
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      src/views/nodes/compareBranchNode.ts

+ 6
- 3
src/views/nodes/compareBranchNode.ts View File

@ -73,7 +73,7 @@ export class CompareBranchNode extends ViewNode
expand: false,
includeRepoName: true,
files: {
ref1: this.branch.ref,
ref1: this.compareWithWorkingTree ? '' : this.branch.ref,
ref2: this._compareWith.ref || 'HEAD',
query: this.getBehindFilesQuery.bind(this),
},
@ -243,8 +243,11 @@ export class CompareBranchNode extends ViewNode
private async getBehindFilesQuery(): Promise<FilesQueryResults> {
const files = await Container.git.getDiffStatus(
this.uri.repoPath!,
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
GitRevision.createRange(this.branch.ref, this._compareWith?.ref || 'HEAD', '...'),
this.compareWithWorkingTree
? // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
this._compareWith?.ref || 'HEAD'
: // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
GitRevision.createRange(this.branch.ref, this._compareWith?.ref || 'HEAD', '...'),
);
return {

Loading…
Cancel
Save