summaryrefslogtreecommitdiff
path: root/doc/api
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-06 18:01:03 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-06 18:01:03 +0300
commitda6f4f06c7b8ad32ae014fd232037ec05e8e8a80 (patch)
treebcac37229f4a8c87278be8ab9c675f343057431a /doc/api
parent470f9064facd7a5452947ea7d3b650ea885c2195 (diff)
downloadgitlab-ce-da6f4f06c7b8ad32ae014fd232037ec05e8e8a80.tar.gz
API: implement retrieve of repository tree
Diffstat (limited to 'doc/api')
-rw-r--r--doc/api/repositories.md50
1 files changed, 50 insertions, 0 deletions
diff --git a/doc/api/repositories.md b/doc/api/repositories.md
index 90fda387947..7a9f766ba1d 100644
--- a/doc/api/repositories.md
+++ b/doc/api/repositories.md
@@ -239,6 +239,56 @@ Parameters:
]
```
+## List repository tree
+
+Get a list of repository files and directories in a project.
+
+```
+GET /projects/:id/repository/tree
+```
+
+Parameters:
+
++ `id` (required) - The ID of a project
++ `path` (optional) - The path inside repository. Used to get contend of subdirectories
++ `ref_name` (optional) - The name of a repository branch or tag or if not given the default branch
+
+```json
+
+[{
+ "name": "assets",
+ "type": "tree",
+ "mode": "040000",
+ "id": "6229c43a7e16fcc7e95f923f8ddadb8281d9c6c6"
+}, {
+ "name": "contexts",
+ "type": "tree",
+ "mode": "040000",
+ "id": "faf1cdf33feadc7973118ca42d35f1e62977e91f"
+}, {
+ "name": "controllers",
+ "type": "tree",
+ "mode": "040000",
+ "id": "95633e8d258bf3dfba3a5268fb8440d263218d74"
+}, {
+ "name": "Rakefile",
+ "type": "blob",
+ "mode": "100644",
+ "id": "35b2f05cbb4566b71b34554cf184a9d0bd9d46d6"
+}, {
+ "name": "VERSION",
+ "type": "blob",
+ "mode": "100644",
+ "id": "803e4a4f3727286c3093c63870c2b6524d30ec4f"
+}, {
+ "name": "config.ru",
+ "type": "blob",
+ "mode": "100644",
+ "id": "dfd2d862237323aa599be31b473d70a8a817943b"
+}]
+
+```
+
## Raw blob content