Skip to content

Commit

Permalink
Allow null as branch name when pushing
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbinHabermehl committed Jan 27, 2016
1 parent d57f5c9 commit e5869fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ Pushes changes to remote repo

`remote`: String, name of remote, default: `origin`

`branch`: String, branch, default: `master`
`branch`: String (may be `null`), branch, default: `master`

`opt`: Object (optional) `{args: 'options', cwd: '/cwd/path', quiet: true}`

Expand Down
6 changes: 5 additions & 1 deletion lib/push.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ var escape = require('any-shell-escape');
module.exports = function (remote, branch, opt, cb) {

if (!remote) remote = 'origin';
if (!branch) branch = 'master';
if (branch === null) {
branch = '';
} else if (!branch) {
branch = 'master';
}
if (!cb && typeof opt === 'function') {
cb = opt;
opt = {};
Expand Down

0 comments on commit e5869fe

Please sign in to comment.