From 103670c7a94076642771370b4962c6e95b0b7bd6 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 24 Aug 2020 02:34:42 -0400 Subject: [PATCH] Fixes issue with pull/push on some nodes --- src/views/viewCommands.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/views/viewCommands.ts b/src/views/viewCommands.ts index 7389e3e..535bea8 100644 --- a/src/views/viewCommands.ts +++ b/src/views/viewCommands.ts @@ -351,22 +351,21 @@ export class ViewCommands { @debug() private pull(node: RepositoryNode | BranchNode | BranchTrackingStatusNode) { + if (node instanceof RepositoryNode) return GitActions.pull(node.repo); if (node instanceof BranchNode || node instanceof BranchTrackingStatusNode) { - node = node.getParent() as RepositoryNode; + return GitActions.pull(node.repoPath); } - if (!(node instanceof RepositoryNode)) return Promise.resolve(); - return GitActions.pull(node.repo); + return Promise.resolve(); } @debug() private push(node: RepositoryNode | BranchNode | BranchTrackingStatusNode, force?: boolean) { + if (node instanceof RepositoryNode) return GitActions.push(node.repo, force); if (node instanceof BranchNode || node instanceof BranchTrackingStatusNode) { - node = node.getParent() as RepositoryNode; + return GitActions.push(node.repoPath, force); } - if (!(node instanceof RepositoryNode)) return Promise.resolve(); - - return GitActions.push(node.repo, force); + return Promise.resolve(); } @debug()