From e4fb006dc7e46f136b5c85baee0cefbcdf961750 Mon Sep 17 00:00:00 2001 From: Eric Amodio <eamodio@gmail.com> Date: Wed, 10 Mar 2021 01:53:52 -0500 Subject: [PATCH] Limits default commits shown with multiple repos --- src/views/commitsView.ts | 1 + src/views/nodes/branchNode.ts | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/views/commitsView.ts b/src/views/commitsView.ts index 4300b54..48c6218 100644 --- a/src/views/commitsView.ts +++ b/src/views/commitsView.ts @@ -55,6 +55,7 @@ export class CommitsRepositoryNode extends RepositoryFolderNode<CommitsView, Bra this.child = new BranchNode(this.uri, this.view, this, branch, true, { expanded: true, + limitCommits: !this.splatted, showComparison: this.view.config.showBranchComparison, showCurrent: false, showTracking: true, diff --git a/src/views/nodes/branchNode.ts b/src/views/nodes/branchNode.ts index bb56b89..37cc964 100644 --- a/src/views/nodes/branchNode.ts +++ b/src/views/nodes/branchNode.ts @@ -40,6 +40,7 @@ export class BranchNode private _children: ViewNode[] | undefined; private readonly options: { expanded: boolean; + limitCommits: boolean; showAsCommits: boolean; showComparison: false | ViewShowBranchComparison; showCurrent: boolean; @@ -59,6 +60,7 @@ export class BranchNode options?: { expanded?: boolean; + limitCommits?: boolean; showAsCommits?: boolean; showComparison?: false | ViewShowBranchComparison; showCurrent?: boolean; @@ -71,6 +73,7 @@ export class BranchNode this.options = { expanded: false, + limitCommits: false, showAsCommits: false, showComparison: false, // Hide the current branch checkmark when the node is displayed as a root @@ -437,7 +440,11 @@ export class BranchNode private _log: GitLog | undefined; private async getLog() { if (this._log == null) { - let limit = this.limit ?? (this.root ? this.view.config.pageItemLimit : this.view.config.defaultItemLimit); + let limit = + this.limit ?? + (this.root && !this.options.limitCommits + ? this.view.config.pageItemLimit + : this.view.config.defaultItemLimit); // Try to show more commits if they are unpublished if (limit !== 0 && this.branch.state.ahead > limit) { limit = Math.min(this.branch.state.ahead + 1, limit * 2);