Resolves #1004 -- fix arg parsing on git pull

This commit is contained in:
Peter Cottle 2022-08-29 16:25:51 -06:00
parent 88a6d34e91
commit ad04b2d8d8
2 changed files with 10 additions and 0 deletions

View file

@ -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',

View file

@ -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