mirror of
https://github.com/danog/gift.git
synced 2024-11-26 20:04:47 +01:00
Adding branch parameter to repo.remote_push
This commit is contained in:
parent
66865f063b
commit
1c1950793c
@ -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.
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user