Browse Source

Fixes load more in file history with renames

main
Eric Amodio 1 year ago
parent
commit
54b7daa47a
1 changed files with 13 additions and 2 deletions
  1. +13
    -2
      src/env/node/git/localGitProvider.ts

+ 13
- 2
src/env/node/git/localGitProvider.ts View File

@ -3785,7 +3785,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
): Promise<GitLog | undefined> { ): Promise<GitLog | undefined> {
const paths = await this.isTrackedWithDetails(path, repoPath, ref); const paths = await this.isTrackedWithDetails(path, repoPath, ref);
if (paths == null) { if (paths == null) {
Logger.log(scope, `Skipping blame; '${path}' is not tracked`);
Logger.log(scope, `Skipping log; '${path}' is not tracked`);
return emptyPromise as Promise<GitLog>; return emptyPromise as Promise<GitLog>;
} }
@ -3868,7 +3868,18 @@ export class LocalGitProvider implements GitProvider, Disposable {
moreLimit = moreLimit ?? configuration.get('advanced.maxSearchItems') ?? 0; moreLimit = moreLimit ?? configuration.get('advanced.maxSearchItems') ?? 0;
const ref = last(log.commits.values())?.ref;
const commit = last(log.commits.values());
let ref;
if (commit != null) {
ref = commit.ref;
// Check to make sure the filename hasn't changed and if it has use the previous
if (commit.file != null) {
const path = commit.file.originalPath ?? commit.file.path;
if (path !== relativePath) {
relativePath = path;
}
}
}
const moreLog = await this.getLogForFile(log.repoPath, relativePath, { const moreLog = await this.getLogForFile(log.repoPath, relativePath, {
...options, ...options,
limit: moreUntil == null ? moreLimit : 0, limit: moreUntil == null ? moreLimit : 0,

Loading…
Cancel
Save