Browse Source

Fixes #1148 - loading more with renames fails

main
Eric Amodio 4 years ago
parent
commit
297d1658c8
3 changed files with 18 additions and 6 deletions
  1. +2
    -1
      CHANGELOG.md
  2. +5
    -5
      package.json
  3. +11
    -0
      src/git/gitService.ts

+ 2
- 1
CHANGELOG.md View File

@ -8,8 +8,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Fixed
- Fixes [#1150](https://github.com/eamodio/vscode-gitlens/issues/1150) - Cannot read property 'provider' of undefined
- Fixes [#1148](https://github.com/eamodio/vscode-gitlens/issues/1148) - Follow renames on File History cannot load more history
- Fixes [#1157](https://github.com/eamodio/vscode-gitlens/issues/1157) - GitLens report `X files changed` when comparing working tree with a branch having identical files
- Fixes [#1150](https://github.com/eamodio/vscode-gitlens/issues/1150) - Cannot read property 'provider' of undefined
## [11.0.0] - 2020-11-14

+ 5
- 5
package.json View File

@ -3964,13 +3964,13 @@
},
{
"command": "gitlens.views.fileHistory.setRenameFollowingOn",
"title": "Toggle Renames: Don't Follow",
"title": "Toggle Renames: Not Following",
"category": "GitLens",
"enablement": "!config.gitlens.advanced.fileHistoryShowAllBranches"
},
{
"command": "gitlens.views.fileHistory.setRenameFollowingOff",
"title": "Toggle Renames: Follow",
"title": "Toggle Renames: Following",
"category": "GitLens",
"enablement": "!config.gitlens.advanced.fileHistoryShowAllBranches"
},
@ -6032,17 +6032,17 @@
},
{
"command": "gitlens.views.fileHistory.setRenameFollowingOn",
"when": "view =~ /^gitlens\\.views\\.fileHistory/ && !gitlens:views:fileHistory:cursorFollowing && !config.gitlens.advanced.fileHistoryFollowsRenames && !config.gitlens.advanced.fileHistoryShowAllBranches",
"when": "view =~ /^gitlens\\.views\\.fileHistory/ && !gitlens:views:fileHistory:cursorFollowing && config.gitlens.advanced.fileHistoryShowAllBranches",
"group": "3_gitlens@1"
},
{
"command": "gitlens.views.fileHistory.setRenameFollowingOn",
"when": "view =~ /^gitlens\\.views\\.fileHistory/ && !gitlens:views:fileHistory:cursorFollowing && config.gitlens.advanced.fileHistoryShowAllBranches",
"when": "view =~ /^gitlens\\.views\\.fileHistory/ && !gitlens:views:fileHistory:cursorFollowing && !config.gitlens.advanced.fileHistoryShowAllBranches && !config.gitlens.advanced.fileHistoryFollowsRenames",
"group": "3_gitlens@1"
},
{
"command": "gitlens.views.fileHistory.setRenameFollowingOff",
"when": "view =~ /^gitlens\\.views\\.fileHistory/ && !gitlens:views:fileHistory:cursorFollowing && config.gitlens.advanced.fileHistoryFollowsRenames && !config.gitlens.advanced.fileHistoryShowAllBranches",
"when": "view =~ /^gitlens\\.views\\.fileHistory/ && !gitlens:views:fileHistory:cursorFollowing && !config.gitlens.advanced.fileHistoryShowAllBranches && config.gitlens.advanced.fileHistoryFollowsRenames",
"group": "3_gitlens@1"
},
{

+ 11
- 0
src/git/gitService.ts View File

@ -2278,6 +2278,17 @@ export class GitService implements Disposable {
query: (limit: number | undefined) =>
this.getLogForFile(log.repoPath, fileName, { ...options, limit: limit }),
};
if (options.renames) {
const renamed = Iterables.find(
moreLog.commits.values(),
c => Boolean(c.originalFileName) && c.originalFileName !== fileName,
);
if (renamed != null) {
fileName = renamed.originalFileName!;
}
}
mergedLog.more = this.getLogForFileMoreFn(mergedLog, fileName, options);
return mergedLog;

Loading…
Cancel
Save