From f56a670be2844282ea09ad4f8496dbd1e96f5e22 Mon Sep 17 00:00:00 2001 From: Brock Peabody Date: Wed, 6 Mar 2019 10:38:12 -0500 Subject: [PATCH] Fix rebase deduction logic in pull. I think there must have been a change in the way argparse handles defaults, and where previously we were getting an `undefined` we are now getting a `null`. --- node/lib/util/pull.js | 2 +- node/test/util/pull.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/node/lib/util/pull.js b/node/lib/util/pull.js index 5b3d4993f..90f165f92 100644 --- a/node/lib/util/pull.js +++ b/node/lib/util/pull.js @@ -100,7 +100,7 @@ ${colors.red(source)} in the remote ${colors.yellow(remoteName)}.`); * @return bool */ exports.userWantsRebase = co.wrap(function*(args, repo, branch) { - if (args.rebase !== undefined) { + if (args.rebase !== undefined && args.rebase !== null) { return args.rebase; } diff --git a/node/test/util/pull.js b/node/test/util/pull.js index 0e818232d..93a7380b5 100644 --- a/node/test/util/pull.js +++ b/node/test/util/pull.js @@ -132,6 +132,10 @@ describe("userWantsRebase", function () { null, null)); + assert.equal(false, yield Pull.userWantsRebase({"rebase": null}, + repo, + master)); + assert.equal(false, yield Pull.userWantsRebase({}, repo, master));