diff --git a/__tests__/remote.spec.js b/__tests__/remote.spec.js index 92ab9610..167ea5cb 100644 --- a/__tests__/remote.spec.js +++ b/__tests__/remote.spec.js @@ -37,6 +37,13 @@ describe('Git Remotes', function() { ); }); + it('pulls with rebase and arguments', function() { + return expectTreeAsync( + 'git checkout -b foo; git clone; git fakeTeamwork foo; git commit; git pull --rebase origin foo', + '%7B%22branches%22%3A%7B%22main%22%3A%7B%22target%22%3A%22C1%22%2C%22id%22%3A%22main%22%2C%22remoteTrackingBranchID%22%3A%22o/main%22%7D%2C%22foo%22%3A%7B%22target%22%3A%22C3%27%22%2C%22id%22%3A%22foo%22%2C%22remoteTrackingBranchID%22%3A%22o/foo%22%7D%2C%22o/main%22%3A%7B%22target%22%3A%22C1%22%2C%22id%22%3A%22o/main%22%2C%22remoteTrackingBranchID%22%3Anull%7D%2C%22o/foo%22%3A%7B%22target%22%3A%22C2%22%2C%22id%22%3A%22o/foo%22%2C%22remoteTrackingBranchID%22%3Anull%7D%7D%2C%22commits%22%3A%7B%22C0%22%3A%7B%22parents%22%3A%5B%5D%2C%22id%22%3A%22C0%22%2C%22rootCommit%22%3Atrue%7D%2C%22C1%22%3A%7B%22parents%22%3A%5B%22C0%22%5D%2C%22id%22%3A%22C1%22%7D%2C%22C3%22%3A%7B%22parents%22%3A%5B%22C1%22%5D%2C%22id%22%3A%22C3%22%7D%2C%22C2%22%3A%7B%22parents%22%3A%5B%22C1%22%5D%2C%22id%22%3A%22C2%22%7D%2C%22C3%27%22%3A%7B%22parents%22%3A%5B%22C2%22%5D%2C%22id%22%3A%22C3%27%22%7D%7D%2C%22tags%22%3A%7B%7D%2C%22HEAD%22%3A%7B%22target%22%3A%22foo%22%2C%22id%22%3A%22HEAD%22%7D%2C%22originTree%22%3A%7B%22branches%22%3A%7B%22main%22%3A%7B%22target%22%3A%22C1%22%2C%22id%22%3A%22main%22%2C%22remoteTrackingBranchID%22%3Anull%7D%2C%22foo%22%3A%7B%22target%22%3A%22C2%22%2C%22id%22%3A%22foo%22%2C%22remoteTrackingBranchID%22%3Anull%7D%7D%2C%22commits%22%3A%7B%22C0%22%3A%7B%22parents%22%3A%5B%5D%2C%22id%22%3A%22C0%22%2C%22rootCommit%22%3Atrue%7D%2C%22C1%22%3A%7B%22parents%22%3A%5B%22C0%22%5D%2C%22id%22%3A%22C1%22%7D%2C%22C2%22%3A%7B%22parents%22%3A%5B%22C1%22%5D%2C%22id%22%3A%22C2%22%7D%7D%2C%22tags%22%3A%7B%7D%2C%22HEAD%22%3A%7B%22target%22%3A%22foo%22%2C%22id%22%3A%22HEAD%22%7D%7D%7D', + ); + }); + it('pushes', function() { return expectTreeAsync( 'git clone; git commit; git push', diff --git a/src/js/git/commands.js b/src/js/git/commands.js index e08122dd..50406209 100644 --- a/src/js/git/commands.js +++ b/src/js/git/commands.js @@ -230,6 +230,9 @@ var commandConfig = { var commandOptions = command.getOptionsMap(); var generalArgs = command.getGeneralArgs(); + if (commandOptions['--rebase']) { + generalArgs = commandOptions['--rebase'].concat(generalArgs); + } command.twoArgsForOrigin(generalArgs); assertOriginSpecified(generalArgs); // here is the deal -- git pull is pretty complex with