summaryrefslogtreecommitdiff
path: root/lib/bitbucket_server/client.rb
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-07-13 15:39:24 -0700
committerStan Hu <stanhu@gmail.com>2018-07-13 15:39:24 -0700
commitc793252e8b33a1b7d071aca90c9c05e54ad973b5 (patch)
tree238d0c479817abd68c23212e44d6484d27f9bb04 /lib/bitbucket_server/client.rb
parentec4109d413f6161b43ad4cc1a6251af30d3bcf03 (diff)
downloadgitlab-ce-c793252e8b33a1b7d071aca90c9c05e54ad973b5.tar.gz
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.rb9
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)