lib/gitlab/client/repository_files.rb in gitlab-4.12.0 vs lib/gitlab/client/repository_files.rb in gitlab-4.13.0
- old
+ new
@@ -23,9 +23,25 @@
headers: { Accept: 'text/plain' },
parser: ::Gitlab::Request::Parser
end
alias repo_file_contents file_contents
+ # Get file blame from repository
+ #
+ # @example
+ # Gitlab.get_file_blame(42, "README.md", "master")
+ #
+ # @param [Integer, String] project The ID or name of a project.
+ # @param [String] file_path The full path of the file.
+ # @param [String] ref The name of branch, tag or commit.
+ # @return [Gitlab::ObjectifiedHash]
+ #
+ def get_file_blame(project, file_path, ref)
+ get("/projects/#{url_encode project}/repository/files/#{url_encode file_path}/blame", query: {
+ ref: ref
+ })
+ end
+
# Gets a repository file.
#
# @example
# Gitlab.get_file(42, "README.md", "master")
#