Fix up merge conflict handling

This commit is contained in:
Nick O'Leary
2018-02-08 22:22:58 +00:00
parent 2f6ac42efe
commit d5619d2b9d
5 changed files with 68 additions and 45 deletions

View File

@@ -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));
}
};

View File

@@ -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") {