mirror of
https://github.com/danog/gift.git
synced 2024-11-30 04:19:37 +01:00
Add force delete (#97)
This commit is contained in:
parent
ca8c35b5e9
commit
b609d3d77b
@ -165,7 +165,7 @@ Get a branch.
|
||||
Create a new branch with `name`, and call the callback when complete
|
||||
with an error, if one occurred.
|
||||
|
||||
### `Repo#delete_branch(delete, callback)`
|
||||
### `Repo#delete_branch(delete, force, callback)`
|
||||
Delete the branch `name`, and call the callback with an error, if one occurred.
|
||||
|
||||
### `Repo#merge(name, [options, ]callback)`
|
||||
|
@ -361,10 +361,14 @@ module.exports = class Repo
|
||||
# Public: Delete the branch with the given name.
|
||||
#
|
||||
# name - String name of the branch to delete.
|
||||
# force - Force delete if true.
|
||||
# callback - Receives `(err)`.
|
||||
#
|
||||
delete_branch: (name, callback) ->
|
||||
@git "branch", {d: true}, name, (err, stdout, stderr) ->
|
||||
delete_branch: (name, force, callback) ->
|
||||
[force, callback] = [false, force] if !callback
|
||||
opts = {d: true}
|
||||
opts = {D: true} if force
|
||||
@git "branch", opts, name, (err, stdout, stderr) ->
|
||||
return callback err
|
||||
|
||||
# Public: Get the Branch with the given name.
|
||||
|
Loading…
Reference in New Issue
Block a user