Преглед изворни кода

Fixes #1896 deals w/ merge commits without a file

main
Eric Amodio пре 2 година
родитељ
комит
9c902052d6
2 измењених фајлова са 9 додато и 4 уклоњено
  1. +1
    -0
      CHANGELOG.md
  2. +8
    -4
      src/git/parsers/logParser.ts

+ 1
- 0
CHANGELOG.md Прегледај датотеку

@ -38,6 +38,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Fixed
- Fixes [#1896](https://github.com/gitkraken/vscode-gitlens/issues/1896) - Cannot read property 'fsPath' of undefined
- Fixes [#1550](https://github.com/gitkraken/vscode-gitlens/issues/1550) - Push button in commit widget does not trigger "Push force" when ALT is pressed.
- Fixes [#1991](https://github.com/gitkraken/vscode-gitlens/issues/1991) - Git lens status bar entry has an incomprehensible accessibility label
- Fixes [#2125](https://github.com/gitkraken/vscode-gitlens/issues/2125) - "git log" command in version 12.x is very slow

+ 8
- 4
src/git/parsers/logParser.ts Прегледај датотеку

@ -280,7 +280,7 @@ export class GitLogParser {
): GitLog | undefined {
if (!data) return undefined;
let relativeFileName: string;
let relativeFileName: string | undefined;
let entry: LogEntry = {};
let line: string | undefined = undefined;
@ -531,7 +531,11 @@ export class GitLogParser {
);
relativeFileName = normalizePath(relative(repoPath, fileName));
} else {
relativeFileName = entry.path!;
relativeFileName =
entry.path ??
(repoPath != null && fileName != null
? normalizePath(relative(repoPath, fileName))
: undefined);
}
first = false;
@ -578,7 +582,7 @@ export class GitLogParser {
commit: GitCommit | undefined,
type: LogType,
repoPath: string | undefined,
relativeFileName: string,
relativeFileName: string | undefined,
commits: Map<string, GitCommit>,
currentUser: GitUser | undefined,
): void {
@ -600,7 +604,7 @@ export class GitLogParser {
const files: { file?: GitFileChange; files?: GitFileChange[] } = {
files: entry.files?.map(f => new GitFileChange(repoPath!, f.path, f.status, f.originalPath)),
};
if (type === LogType.LogFile) {
if (type === LogType.LogFile && relativeFileName != null) {
files.file = new GitFileChange(
repoPath!,
relativeFileName,

Loading…
Откажи
Сачувај