1
0
mirror of https://github.com/danog/gift.git synced 2024-11-26 20:04:47 +01:00

Merge pull request #28 from pose/push-branch-support

Adding branch parameter to repo.remote_push
This commit is contained in:
Luke Plaster 2014-06-08 13:23:53 +02:00
commit e6df0910bc
2 changed files with 13 additions and 3 deletions

View File

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

View File

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