diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-05-27 11:16:07 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-05-27 11:16:07 +0000 |
commit | 3bdf0e2921c4cac46084834899302b25858e6bde (patch) | |
tree | f1272e4a21f232aaad5ac1e0a5254b13ce1df040 /doc/api | |
parent | 3553e36d169e18025a2409b7055fff082d89f630 (diff) | |
parent | c7e00aca2d68a15c901506f1af4242df92670b6a (diff) | |
download | gitlab-ce-3bdf0e2921c4cac46084834899302b25858e6bde.tar.gz |
Merge branch 'compare-api' into 'master'
Compare api
Fixes #1165
Diffstat (limited to 'doc/api')
-rw-r--r-- | doc/api/repositories.md | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/doc/api/repositories.md b/doc/api/repositories.md index 858fad0a0b5..e9120e17bb8 100644 --- a/doc/api/repositories.md +++ b/doc/api/repositories.md @@ -131,3 +131,56 @@ GET /projects/:id/repository/archive Parameters: + `id` (required) - The ID of a project + `sha` (optional) - The commit sha to download defaults to the tip of the default branch + + +## Compare branches, tags or commits + +``` +GET /projects/:id/repository/compare +``` + +Parameters: ++ `id` (required) - The ID of a project ++ `from` (required) - the commit sha or branch name ++ `to` (required) - the commit sha or branch name + + +``` +GET /projects/:id/repository/compare?from=master&to=feature +``` + +Response: + +```json + +{ + "commit": { + "id": "12d65c8dd2b2676fa3ac47d955accc085a37a9c1", + "short_id": "12d65c8dd2b", + "title": "JS fix", + "author_name": "Dmitriy Zaporozhets", + "author_email": "dmitriy.zaporozhets@gmail.com", + "created_at": "2014-02-27T10:27:00+02:00" + }, + "commits": [{ + "id": "12d65c8dd2b2676fa3ac47d955accc085a37a9c1", + "short_id": "12d65c8dd2b", + "title": "JS fix", + "author_name": "Dmitriy Zaporozhets", + "author_email": "dmitriy.zaporozhets@gmail.com", + "created_at": "2014-02-27T10:27:00+02:00" + }], + "diffs": [{ + "old_path": "files/js/application.js", + "new_path": "files/js/application.js", + "a_mode": null, + "b_mode": "100644", + "diff": "--- a/files/js/application.js\n+++ b/files/js/application.js\n@@ -24,8 +24,10 @@\n //= require g.raphael-min\n //= require g.bar-min\n //= require branch-graph\n-//= require highlightjs.min\n-//= require ace/ace\n //= require_tree .\n //= require d3\n //= require underscore\n+\n+function fix() { \n+ alert(\"Fixed\")\n+}", + "new_file": false, + "renamed_file": false, + "deleted_file": false + }], + "compare_timeout": false, + "compare_same_ref": false +} +``` |