lib/gitlab/client/repository_files.rb in gitlab-4.2.0 vs lib/gitlab/client/repository_files.rb in gitlab-4.3.0
- old
+ new
@@ -13,11 +13,10 @@
# @param [Integer, String] project The ID or name of a project.
# @param [String] filepath The relative path of the file in the repository
# @param [String] ref The name of a repository branch or tag or if not given the default branch.
# @return [String]
def file_contents(project, filepath, ref='master')
- ref = URI.encode(ref, /\W/)
get "/projects/#{url_encode project}/repository/files/#{url_encode filepath}/raw",
query: { ref: ref},
format: nil,
headers: { Accept: 'text/plain' },
parser: ::Gitlab::Request::Parser
@@ -93,10 +92,11 @@
# @param [Hash] options Optional additional details for commit
# @option options [String] :author_name Commit author's name
# @option options [String] :author_email Commit author's email address
# @return [Gitlab::ObjectifiedHash]
def remove_file(project, path, branch, commit_message, options = {})
- delete("/projects/#{url_encode project}/repository/files/#{url_encode path}", body: {
+ delete("/projects/#{url_encode project}/repository/files/#{url_encode path}",
+ body: {
branch: branch,
commit_message: commit_message
}.merge(options))
end