summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorGabor Nagy <mail@aigeruth.hu>2013-08-25 23:21:00 +0200
committerGabor Nagy <mail@aigeruth.hu>2013-08-25 23:48:11 +0200
commitd139cc6b3283cef8f14660738d423ea63317203c (patch)
tree8de146b9f07a4aa74f40d0c48cfac156783747e8 /lib/api
parent2b36dee64485062c69779217d4a202e5ca1b67bd (diff)
downloadgitlab-ce-d139cc6b3283cef8f14660738d423ea63317203c.tar.gz
Adds feature: get a diff via API.
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/repositories.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/api/repositories.rb b/lib/api/repositories.rb
index 5db17b7e414..7e806546d02 100644
--- a/lib/api/repositories.rb
+++ b/lib/api/repositories.rb
@@ -102,6 +102,20 @@ module API
present commits, with: Entities::RepoCommit
end
+ # Get a specific commit of a project
+ #
+ # Parameters:
+ # id (required) - The ID of a project
+ # sha (required) - The commit or branch name
+ # Example Request:
+ # GET /projects/:id/repository/commit/:sha
+ get ":id/repository/commit/:sha" do
+ authorize! :download_code, user_project
+ sha = params[:sha]
+ result = CommitLoadContext.new(user_project, current_user, {id: sha}).execute
+ result[:commit].diffs
+ end
+
# Get a project repository tree
#
# Parameters: