ソースを参照

Fixes issues opening the working file if renamed

main
Eric Amodio 6年前
コミット
d0354de864
3個のファイルの変更11行の追加1行の削除
  1. +1
    -0
      CHANGELOG.md
  2. +7
    -0
      src/commands/openWorkingFile.ts
  3. +3
    -1
      src/gitService.ts

+ 1
- 0
CHANGELOG.md ファイルの表示

@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Fixed
- Fixes [#35](https://github.com/eamodio/vscode-gitlens/issues/35) - Copy Commit Sha to Clipboard not working (linux)
- Fixes issue where the last commit of a file history would be broken (failed to parse correctly)
- Fixes issue with *Open Working File* command (`gitlens.openWorkingFile`) failing when a file was renamed
## [8.0.0-beta3] - 2018-02-03
### Added

+ 7
- 0
src/commands/openWorkingFile.ts ファイルの表示

@ -5,6 +5,7 @@ import { FileAnnotationType } from '../configuration';
import { Container } from '../container';
import { GitUri } from '../gitService';
import { Logger } from '../logger';
import * as path from 'path';
export interface OpenWorkingFileCommandArgs {
uri?: Uri;
@ -31,6 +32,12 @@ export class OpenWorkingFileCommand extends ActiveEditorCommand {
if (uri === undefined) return undefined;
args.uri = await GitUri.fromUri(uri);
if (args.uri instanceof GitUri && args.uri.sha) {
const [fileName, repoPath] = await Container.git.findWorkingFileName(args.uri.fsPath, args.uri.repoPath);
if (fileName !== undefined && repoPath !== undefined) {
args.uri = new GitUri(Uri.file(path.resolve(repoPath, fileName)), repoPath);
}
}
}
if (args.line !== undefined && args.line !== 0) {

+ 3
- 1
src/gitService.ts ファイルの表示

@ -374,7 +374,9 @@ export class GitService extends Disposable {
repoPath = await this.getRepoPath(fileName, { ref: ref });
[fileName, repoPath] = Git.splitPath(fileName, repoPath);
}
else {
fileName = Strings.normalizePath(path.relative(repoPath, fileName));
}
}
else {
const c = commitOrFileName;

読み込み中…
キャンセル
保存