Handle allow-unrelated-histories option on pull

This commit is contained in:
Nick O'Leary
2018-02-08 23:21:14 +00:00
parent d5619d2b9d
commit 06a6a4408f
5 changed files with 88 additions and 54 deletions

View File

@@ -428,7 +428,7 @@ module.exports = {
var args = ["branch","--set-upstream-to",remoteBranch];
return runGitCommand(args,cwd);
},
pull: function(cwd,remote,branch,auth,gitUser) {
pull: function(cwd,remote,branch,allowUnrelatedHistories,auth,gitUser) {
var args = ["pull"];
if (remote && branch) {
args.push(remote);
@@ -440,8 +440,9 @@ module.exports = {
args.unshift('user.email="'+gitUser['email']+'"');
args.unshift('-c');
}
//TODO: only do this if asked for
args.push("--allow-unrelated-histories");
if (allowUnrelatedHistories) {
args.push("--allow-unrelated-histories");
}
var promise;
if (auth) {
if ( auth.key_path ) {