Skip to content

Commit

Permalink
Adding branch parameter to repo.remote_push
Browse files Browse the repository at this point in the history
  • Loading branch information
pose committed May 18, 2014
1 parent 66865f0 commit 1c19507
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,12 @@ Remove a remote.
### `Repo#remote_fetch(name, callback)`
`git fetch <name>`

### `Repo#remote_push(name, callback)`
### `Repo#remote_push(name, [branch, ]callback)`
`git push <name>`

with branch parameter specified:
`git push <name> <branch>`

### `Repo#status(callback)`
Uses `--porcelain` to parse repository status in a way that is agnostic of system language. The callback receives `(err, status)`. See below for a definition of what `status` is.

Expand Down
11 changes: 9 additions & 2 deletions src/repo.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,17 @@ module.exports = class Repo
# Public: `git push <name>`.
#
# name - String name of the remote
# branch - (optional) Branch to push
# callback - Receives `(err)`.
#
remote_push: (name, callback) ->
@git "push", {}, name
remote_push: (name, branch, callback) ->
if !callback
callback = branch
args = name
else
args = [name, branch]

@git "push", {}, args
, (err, stdout, stderr) ->
callback err

Expand Down

0 comments on commit 1c19507

Please sign in to comment.