diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2017-07-05 01:33:53 +0000 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2017-07-05 01:33:53 +0000 |
commit | e19ce03a1a785c2cf61d76b535bc6b32e0957606 (patch) | |
tree | e7989a18b757124db2d58cf1f96ac892bc59c219 /lib/gitlab_net.rb | |
parent | 0a64624152735766c428d1532e434dd0bf5a9748 (diff) | |
download | gitlab-shell-revert-ffecea6a.tar.gz |
Revert "Merge branch 'revert-gl-repository' into 'master'"revert-ffecea6a
This reverts merge request !142
Diffstat (limited to 'lib/gitlab_net.rb')
-rw-r--r-- | lib/gitlab_net.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/gitlab_net.rb b/lib/gitlab_net.rb index fad06d6..d0bc0bc 100644 --- a/lib/gitlab_net.rb +++ b/lib/gitlab_net.rb @@ -67,11 +67,13 @@ class GitlabNet JSON.parse(resp.body) rescue {} end - def merge_request_urls(gl_repository, repo_path, changes) + def merge_request_urls(gl_repository, changes) changes = changes.join("\n") unless changes.kind_of?(String) changes = changes.encode('UTF-8', 'ASCII', invalid: :replace, replace: '') - url = "#{host}/merge_request_urls?project=#{URI.escape(repo_path)}&changes=#{URI.escape(changes)}" - url += "&gl_repository=#{URI.escape(gl_repository)}" if gl_repository + url = "#{host}/merge_request_urls?" \ + "gl_repository=#{URI.escape(gl_repository)}&" \ + "changes=#{URI.escape(changes)}" + resp = get(url) JSON.parse(resp.body) rescue [] end @@ -96,9 +98,8 @@ class GitlabNet {} end - def notify_post_receive(gl_repository, repo_path) - params = { gl_repository: gl_repository, project: repo_path } - resp = post("#{host}/notify_post_receive", params) + def notify_post_receive(gl_repository) + resp = post("#{host}/notify_post_receive", gl_repository: gl_repository) resp.code == '200' rescue |