Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,12 @@ Default value: `master`

The branch to pull from. E.g.: `master`, `develop` (optional).

#### options.rebase
Type: `Mixed`,
Default value: `false`

Will set the rebase option. You can set it to `true` (Boolean) or 'preserve' (String).

## The "gitfetch" task

Download objects and refs from a repo.
Expand Down
11 changes: 11 additions & 0 deletions lib/command_pull.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ var ArgUtil = require('flopmang');

module.exports = function (task, exec, done) {
var argUtil = new ArgUtil(task, [
{
option: 'rebase',
customFlagFn: function (arg) {
if (arg.value === true) {
return '--rebase=true';
} else if (arg.value === 'preserve') {
return '--rebase=preserve';
}
return null;
}
},
{
option: 'remote',
defaultValue: 'origin',
Expand Down
22 changes: 22 additions & 0 deletions test/pull_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,26 @@ describe('pull', function () {
.expect(['pull', 'origin', 'master'])
.run(done);
});

it('should accept --rebase option', function (done) {
var options = {
branch: 'master',
rebase: true
};

new Test(command, options)
.expect(['pull', '--rebase=true', 'origin', 'master'])
.run(done);
});

it('should accept --rebase option with preserve', function (done) {
var options = {
branch: 'master',
rebase: 'preserve'
};

new Test(command, options)
.expect(['pull', '--rebase=preserve', 'origin', 'master'])
.run(done);
});
});