Browse Source

Fixes issue showing changes with working with renamed files

main
Eric Amodio 6 years ago
parent
commit
6e5a82e469
3 changed files with 8 additions and 1 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +3
    -1
      src/commands/diffWithWorking.ts
  3. +4
    -0
      src/git/models/commit.ts

+ 1
- 0
CHANGELOG.md View File

@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Fixed
- Fixes [#454](https://github.com/eamodio/vscode-gitlens/issues/454) - Search for string returns merge commits (unlike raw `git log -S`)
- Fixes issue showing changes with untracked stashed files
- Fixes issue showing changes with working file when the file has been renamed
## [8.5.2] - 2018-07-20
### Fixed

+ 3
- 1
src/commands/diffWithWorking.ts View File

@ -80,6 +80,8 @@ export class DiffWithWorkingCommand extends ActiveEditorCommand {
const [workingFileName] = await Container.git.findWorkingFileName(gitUri.fsPath, gitUri.repoPath);
if (workingFileName === undefined) return undefined;
args.commit.workingFileName = workingFileName;
const diffArgs: DiffWithCommandArgs = {
repoPath: args.commit.repoPath,
lhs: {
@ -88,7 +90,7 @@ export class DiffWithWorkingCommand extends ActiveEditorCommand {
},
rhs: {
sha: '',
uri: args.commit.uri
uri: args.commit.workingUri
},
line: args.line,
showOptions: args.showOptions

+ 4
- 0
src/git/models/commit.ts View File

@ -153,6 +153,10 @@ export abstract class GitCommit {
return Uri.file(path.resolve(this.repoPath, this.fileName));
}
get workingUri(): Uri {
return this.workingFileName ? Uri.file(path.resolve(this.repoPath, this.workingFileName)) : this.uri;
}
private _dateFormatter?: Dates.IDateFormatter;
formatDate(format?: string | null) {

Loading…
Cancel
Save