From 5f12ee8ba767868c2b18486f73ba3987e0847304 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 12 Oct 2020 04:23:37 -0400 Subject: [PATCH] Moves file changes to be first --- src/views/nodes/branchTrackingStatusNode.ts | 31 +++++++++++++++-------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/views/nodes/branchTrackingStatusNode.ts b/src/views/nodes/branchTrackingStatusNode.ts index 5ef9490..ec00438 100644 --- a/src/views/nodes/branchTrackingStatusNode.ts +++ b/src/views/nodes/branchTrackingStatusNode.ts @@ -79,21 +79,7 @@ export class BranchTrackingStatusNode extends ViewNode implement commits = log.commits.values(); } - const children = [ - ...insertDateMarkers( - Iterables.map( - commits, - c => new CommitNode(this.view, this, c, this.upstreamType === 'ahead', this.branch), - ), - this, - 1, - ), - ]; - - if (log.hasMore) { - children.push(new LoadMoreNode(this.view, this, children[children.length - 1])); - } - + const children = []; if (!this.isReposView && this.status.upstream && this.upstreamType === 'ahead' && this.status.state.ahead > 0) { children.push( new BranchTrackingStatusFilesNode( @@ -107,6 +93,21 @@ export class BranchTrackingStatusNode extends ViewNode implement ); } + children.push( + ...insertDateMarkers( + Iterables.map( + commits, + c => new CommitNode(this.view, this, c, this.upstreamType === 'ahead', this.branch), + ), + this, + 1, + ), + ); + + if (log.hasMore) { + children.push(new LoadMoreNode(this.view, this, children[children.length - 1])); + } + return children; }