diff options
author | Stan Hu <stanhu@gmail.com> | 2018-07-14 01:39:24 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-07-14 01:39:24 +0300 |
commit | c793252e8b33a1b7d071aca90c9c05e54ad973b5 (patch) | |
tree | 238d0c479817abd68c23212e44d6484d27f9bb04 /lib/bitbucket_server/client.rb | |
parent | ec4109d413f6161b43ad4cc1a6251af30d3bcf03 (diff) |
Add support for deleting branches via the Bitbucket Server API
Diffstat (limited to 'lib/bitbucket_server/client.rb')
-rw-r--r-- | lib/bitbucket_server/client.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/bitbucket_server/client.rb b/lib/bitbucket_server/client.rb index 802fe7953ce..bfa8301f643 100644 --- a/lib/bitbucket_server/client.rb +++ b/lib/bitbucket_server/client.rb @@ -36,6 +36,15 @@ module BitbucketServer connection.post("/projects/#{project_key}/repos/#{repo}/branches", payload.to_json) end + def delete_branch(project_key, repo, branch_name, sha) + payload = { + name: Gitlab::Git::BRANCH_REF_PREFIX + branch_name, + dryRun: false + } + + connection.delete(:branches, "/projects/#{project_key}/repos/#{repo}/branches", payload.to_json) + end + private def get_collection(path, type) |