diff --git a/README.md b/README.md index dbe448c..9e06532 100644 --- a/README.md +++ b/README.md @@ -121,9 +121,12 @@ Remove a remote. ### `Repo#remote_fetch(name, callback)` `git fetch ` -### `Repo#remote_push(name, callback)` +### `Repo#remote_push(name, [branch, ]callback)` `git push ` +with branch parameter specified: +`git push ` + ### `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. diff --git a/src/repo.coffee b/src/repo.coffee index c97fbdf..16d8541 100644 --- a/src/repo.coffee +++ b/src/repo.coffee @@ -210,10 +210,17 @@ module.exports = class Repo # Public: `git push `. # # 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