Browse Source

Limits default commits shown with multiple repos

main
Eric Amodio 4 years ago
parent
commit
e4fb006dc7
2 changed files with 9 additions and 1 deletions
  1. +1
    -0
      src/views/commitsView.ts
  2. +8
    -1
      src/views/nodes/branchNode.ts

+ 1
- 0
src/views/commitsView.ts View File

@ -55,6 +55,7 @@ export class CommitsRepositoryNode extends RepositoryFolderNode
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,

+ 8
- 1
src/views/nodes/branchNode.ts View File

@ -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);

||||||
x
 
000:0
Loading…
Cancel
Save