mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Fix up merge conflict handling
This commit is contained in:
@@ -523,11 +523,11 @@ Project.prototype.pull = function (user,remoteBranchName,setRemote) {
|
||||
if (setRemote) {
|
||||
return gitTools.setUpstream(this.path, remoteBranchName).then(function() {
|
||||
self.currentRemote = self.parseRemoteBranch(remoteBranchName).remote;
|
||||
return gitTools.pull(self.path, null, null, authCache.get(self.name,self.remotes[self.currentRemote].fetch,username));
|
||||
return gitTools.pull(self.path, null, null, authCache.get(self.name,self.remotes[self.currentRemote].fetch,username),getGitUser(user));
|
||||
})
|
||||
} else {
|
||||
var remote = this.parseRemoteBranch(remoteBranchName);
|
||||
return gitTools.pull(this.path, remote.remote, remote.branch, authCache.get(this.name,this.remotes[remote.remote||self.currentRemote].fetch,username));
|
||||
return gitTools.pull(this.path, remote.remote, remote.branch, authCache.get(this.name,this.remotes[remote.remote||self.currentRemote].fetch,username),getGitUser(user));
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -428,12 +428,20 @@ module.exports = {
|
||||
var args = ["branch","--set-upstream-to",remoteBranch];
|
||||
return runGitCommand(args,cwd);
|
||||
},
|
||||
pull: function(cwd,remote,branch,auth) {
|
||||
pull: function(cwd,remote,branch,auth,gitUser) {
|
||||
var args = ["pull"];
|
||||
if (remote && branch) {
|
||||
args.push(remote);
|
||||
args.push(branch);
|
||||
}
|
||||
if (gitUser && gitUser['name'] && gitUser['email']) {
|
||||
args.unshift('user.name="'+gitUser['name']+'"');
|
||||
args.unshift('-c');
|
||||
args.unshift('user.email="'+gitUser['email']+'"');
|
||||
args.unshift('-c');
|
||||
}
|
||||
//TODO: only do this if asked for
|
||||
args.push("--allow-unrelated-histories");
|
||||
var promise;
|
||||
if (auth) {
|
||||
if ( auth.key_path ) {
|
||||
@@ -556,7 +564,7 @@ module.exports = {
|
||||
return runGitCommand(args,cwd,env);
|
||||
},
|
||||
getFileDiff(cwd,file,type) {
|
||||
var args = ["diff"];
|
||||
var args = ["diff","-w"];
|
||||
if (type === "tree") {
|
||||
// nothing else to do
|
||||
} else if (type === "index") {
|
||||
|
Reference in New Issue
Block a user