Преглед на файлове

Fixes #812 - diffWithPrev with uncommitted changes

main
Eric Amodio преди 5 години
родител
ревизия
4fedcd8fae
променени са 2 файла, в които са добавени 28 реда и са изтрити 15 реда
  1. +6
    -0
      CHANGELOG.md
  2. +22
    -15
      src/commands/diffWithPrevious.ts

+ 6
- 0
CHANGELOG.md Целия файл

@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
### Fixed
- Fixes [#812](https://github.com/eamodio/vscode-gitlens/issues/812) - Regression in 9.9.2: Clicking changed file in Repository Browser opens diff view between WorkingTree <-> WorkingTree, not index
## [9.9.2] - 2019-08-01
### Added

+ 22
- 15
src/commands/diffWithPrevious.ts Целия файл

@ -50,24 +50,31 @@ export class DiffWithPreviousCommand extends ActiveEditorCommand {
args.line = editor == null ? 0 : editor.selection.active.line;
}
let gitUri;
if (args.commit !== undefined) {
const diffArgs: DiffWithCommandArgs = {
repoPath: args.commit.repoPath,
lhs: {
sha: `${args.commit.sha}^`,
uri: args.commit.originalUri
},
rhs: {
sha: args.commit.sha || '',
uri: args.commit.uri
},
line: args.line,
showOptions: args.showOptions
};
return commands.executeCommand(Commands.DiffWith, diffArgs);
if (!args.commit.isUncommitted) {
const diffArgs: DiffWithCommandArgs = {
repoPath: args.commit.repoPath,
lhs: {
sha: `${args.commit.sha}^`,
uri: args.commit.originalUri
},
rhs: {
sha: args.commit.sha || '',
uri: args.commit.uri
},
line: args.line,
showOptions: args.showOptions
};
return commands.executeCommand(Commands.DiffWith, diffArgs);
}
gitUri = GitUri.fromCommit(args.commit);
}
else {
gitUri = await GitUri.fromUri(uri);
}
const gitUri = await GitUri.fromUri(uri);
try {
const diffUris = await Container.git.getPreviousDiffUris(
gitUri.repoPath!,

Зареждане…
Отказ
Запис