From 1377439bb010c2b32733ef2cbe7880543eb66cb6 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 1 Feb 2018 17:08:22 +0000 Subject: [PATCH] Fix pull/push when no tracked branch --- red/runtime/storage/localfilesystem/projects/Project.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/red/runtime/storage/localfilesystem/projects/Project.js b/red/runtime/storage/localfilesystem/projects/Project.js index 9f50d4768..dff62f2c8 100644 --- a/red/runtime/storage/localfilesystem/projects/Project.js +++ b/red/runtime/storage/localfilesystem/projects/Project.js @@ -522,11 +522,12 @@ Project.prototype.pull = function (user,remoteBranchName,setRemote) { var self = this; if (setRemote) { return gitTools.setUpstream(this.path, remoteBranchName).then(function() { - return gitTools.pull(self.path, null, null, authCache.get(self.name,this.remotes[this.currentRemote].fetch,username)); + self.currentRemote = self.parseRemoteBranch(remoteBranchName).remote; + return gitTools.pull(self.path, null, null, authCache.get(self.name,self.remotes[self.currentRemote].fetch,username)); }) } else { var remote = this.parseRemoteBranch(remoteBranchName); - return gitTools.pull(this.path, remote.remote, remote.branch, authCache.get(this.name,this.remotes[this.currentRemote].fetch,username)); + return gitTools.pull(this.path, remote.remote, remote.branch, authCache.get(this.name,this.remotes[remote.remote||self.currentRemote].fetch,username)); } };