From a9812541abc94eb2db72c735422a8d08b22ac764 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 12 Oct 2020 04:20:35 -0400 Subject: [PATCH] Ensures we always show all unpublished commits --- src/views/nodes/branchNode.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/views/nodes/branchNode.ts b/src/views/nodes/branchNode.ts index 66b4ef3..2094491 100644 --- a/src/views/nodes/branchNode.ts +++ b/src/views/nodes/branchNode.ts @@ -168,7 +168,7 @@ export class BranchNode } let unpublished: GitLog | undefined; - if (this.branch.tracking && this.branch.state.ahead) { + if (this.branch.state.ahead > 0) { unpublished = await Container.git.getLog(this.uri.repoPath!, { limit: 0, ref: GitRevision.createRange(this.branch.tracking, 'HEAD'), @@ -329,8 +329,14 @@ export class BranchNode private _log: GitLog | undefined; private async getLog() { if (this._log == null) { + // Ensure we always show all unpublished commits (and the upstream tip) + let limit = this.limit ?? this.view.config.defaultItemLimit; + if (limit !== 0 && this.branch.state.ahead > limit) { + limit = this.branch.state.ahead + 1; + } + this._log = await Container.git.getLog(this.uri.repoPath!, { - limit: this.limit ?? this.view.config.defaultItemLimit, + limit: limit, ref: this.ref.ref, authors: this.options?.authors, });