Skip to content

Commit 297d165

Browse files
committed
Fixes #1148 - loading more with renames fails
1 parent 82d4f66 commit 297d165

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
88

99
### Fixed
1010

11-
- Fixes [#1150](https://github.com/eamodio/vscode-gitlens/issues/1150) - Cannot read property 'provider' of undefined
11+
- Fixes [#1148](https://github.com/eamodio/vscode-gitlens/issues/1148) - Follow renames on File History cannot load more history
1212
- 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
13+
- Fixes [#1150](https://github.com/eamodio/vscode-gitlens/issues/1150) - Cannot read property 'provider' of undefined
1314

1415
## [11.0.0] - 2020-11-14
1516

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3964,13 +3964,13 @@
39643964
},
39653965
{
39663966
"command": "gitlens.views.fileHistory.setRenameFollowingOn",
3967-
"title": "Toggle Renames: Don't Follow",
3967+
"title": "Toggle Renames: Not Following",
39683968
"category": "GitLens",
39693969
"enablement": "!config.gitlens.advanced.fileHistoryShowAllBranches"
39703970
},
39713971
{
39723972
"command": "gitlens.views.fileHistory.setRenameFollowingOff",
3973-
"title": "Toggle Renames: Follow",
3973+
"title": "Toggle Renames: Following",
39743974
"category": "GitLens",
39753975
"enablement": "!config.gitlens.advanced.fileHistoryShowAllBranches"
39763976
},
@@ -6032,17 +6032,17 @@
60326032
},
60336033
{
60346034
"command": "gitlens.views.fileHistory.setRenameFollowingOn",
6035-
"when": "view =~ /^gitlens\\.views\\.fileHistory/ && !gitlens:views:fileHistory:cursorFollowing && !config.gitlens.advanced.fileHistoryFollowsRenames && !config.gitlens.advanced.fileHistoryShowAllBranches",
6035+
"when": "view =~ /^gitlens\\.views\\.fileHistory/ && !gitlens:views:fileHistory:cursorFollowing && config.gitlens.advanced.fileHistoryShowAllBranches",
60366036
"group": "3_gitlens@1"
60376037
},
60386038
{
60396039
"command": "gitlens.views.fileHistory.setRenameFollowingOn",
6040-
"when": "view =~ /^gitlens\\.views\\.fileHistory/ && !gitlens:views:fileHistory:cursorFollowing && config.gitlens.advanced.fileHistoryShowAllBranches",
6040+
"when": "view =~ /^gitlens\\.views\\.fileHistory/ && !gitlens:views:fileHistory:cursorFollowing && !config.gitlens.advanced.fileHistoryShowAllBranches && !config.gitlens.advanced.fileHistoryFollowsRenames",
60416041
"group": "3_gitlens@1"
60426042
},
60436043
{
60446044
"command": "gitlens.views.fileHistory.setRenameFollowingOff",
6045-
"when": "view =~ /^gitlens\\.views\\.fileHistory/ && !gitlens:views:fileHistory:cursorFollowing && config.gitlens.advanced.fileHistoryFollowsRenames && !config.gitlens.advanced.fileHistoryShowAllBranches",
6045+
"when": "view =~ /^gitlens\\.views\\.fileHistory/ && !gitlens:views:fileHistory:cursorFollowing && !config.gitlens.advanced.fileHistoryShowAllBranches && config.gitlens.advanced.fileHistoryFollowsRenames",
60466046
"group": "3_gitlens@1"
60476047
},
60486048
{

src/git/gitService.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2278,6 +2278,17 @@ export class GitService implements Disposable {
22782278
query: (limit: number | undefined) =>
22792279
this.getLogForFile(log.repoPath, fileName, { ...options, limit: limit }),
22802280
};
2281+
2282+
if (options.renames) {
2283+
const renamed = Iterables.find(
2284+
moreLog.commits.values(),
2285+
c => Boolean(c.originalFileName) && c.originalFileName !== fileName,
2286+
);
2287+
if (renamed != null) {
2288+
fileName = renamed.originalFileName!;
2289+
}
2290+
}
2291+
22812292
mergedLog.more = this.getLogForFileMoreFn(mergedLog, fileName, options);
22822293

22832294
return mergedLog;

0 commit comments

Comments
 (0)