diff options
author | Alex Van't Hof <alexvh@cs.columbia.edu> | 2013-08-28 05:22:42 +0400 |
---|---|---|
committer | Alex Van't Hof <alexvh@cs.columbia.edu> | 2013-08-28 05:22:42 +0400 |
commit | 59f428dca20228984e9f50c33b12f54eb15638e5 (patch) | |
tree | 8ba21e90e3e2709ab831f1afe266620abe1d57d5 /doc/api/repositories.md | |
parent | 79f0858a18081d37669883f1b5a32d033197561d (diff) |
Standardize commit diff api url, change blob api url, add get single commit
Use "/commits/:sha/diff" as opposed to "/commit/:sha", keeping in line
with existing api urls (e.g. "/projects/:id", etc.)
Fix 500 error resulting from a diff api call with an invalid commit hash
Move "/commits/:sha/blob" to "/blobs/:sha", leaving the old path for
backwards compatibility.
Add ability to get a single commit via "/commits/:sha"
Diffstat (limited to 'doc/api/repositories.md')
-rw-r--r-- | doc/api/repositories.md | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/doc/api/repositories.md b/doc/api/repositories.md index 229d4409ea6..cb0626972e5 100644 --- a/doc/api/repositories.md +++ b/doc/api/repositories.md @@ -239,12 +239,37 @@ Parameters: ] ``` +## Get a single commit + +Get a specific commit identified by the commit hash or name of a branch or tag. + +``` +GET /projects/:id/repository/commits/:sha +``` + +Parameters: + ++ `id` (required) - The ID of a project ++ `sha` (required) - The commit hash or name of a repository branch or tag + +```json +{ + "id": "6104942438c14ec7bd21c6cd5bd995272b3faff6", + "short_id": "6104942438c", + "title": "Sanitize for network graph", + "author_name": "randx", + "author_email": "dmitriy.zaporozhets@gmail.com", + "created_at": "2012-09-20T09:06:12+03:00" +} +``` + + ## Get the diff of a commit Get the diff of a commit in a project. ``` -GET /projects/:id/repository/commit/:sha +GET /projects/:id/repository/commits/:sha/diff ``` Parameters: @@ -323,7 +348,7 @@ Parameters: Get the raw file contents for a file. ``` -GET /projects/:id/repository/commits/:sha/blob +GET /projects/:id/repository/blobs/:sha ``` Parameters: |