瀏覽代碼

Fixes issue showing changes with working with renamed files

main
Eric Amodio 6 年之前
父節點
當前提交
6e5a82e469
共有 3 個檔案被更改,包括 8 行新增1 行删除
  1. +1
    -0
      CHANGELOG.md
  2. +3
    -1
      src/commands/diffWithWorking.ts
  3. +4
    -0
      src/git/models/commit.ts

+ 1
- 0
CHANGELOG.md 查看文件

@ -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 查看文件

@ -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 查看文件

@ -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…
取消
儲存