Repository.get_git_tree with 'recursive'

This commit is contained in:
Vincent Jacques
2012-03-19 07:32:34 +01:00
parent 6af2bfd0d4
commit 1d2b27824d
4 changed files with 6 additions and 9 deletions
-4
View File
@@ -210,10 +210,6 @@ API `/repos/:user/:repo/git/trees/:sha`
=======================================
* GET: `Repository.get_git_tree`
API `/repos/:user/:repo/git/trees/:sha?recursive=1`
===================================================
* GET: (TODO)
API `/repos/:user/:repo/hooks`
==============================
* GET: `Repository.get_hooks`
+3 -2
View File
@@ -363,6 +363,7 @@ Attributes
* `sha`
* `url`
* `tree`
* `recursive`
Class `Hook`
============
@@ -842,8 +843,8 @@ Git commits
Git trees
---------
* `get_git_tree( sha )`: `GitTree`
* `create_git_tree( tree )`: `GitTree`
* `get_git_tree( sha, [recursive] )`: `GitTree`
* `create_git_tree( tree, [base_tree] )`: `GitTree`
Git blobs
---------
+2 -2
View File
@@ -2,10 +2,10 @@ from GithubObject import *
GitTree = GithubObject(
"GitTree",
BaseUrl( lambda obj: obj._repo._baseUrl() + "/git/trees/" + obj.sha ),
BaseUrl( lambda obj: obj._repo._baseUrl() + "/git/trees/" + obj.sha + "?recursive=1" if obj.recursive else "" ),
InternalSimpleAttributes(
"sha", "url",
"tree",
"_repo",
"_repo", "recursive",
),
)
+1 -1
View File
@@ -86,7 +86,7 @@ Repository._addAttributePolicy( SeveralAttributePolicies( [
ElementCreatable( Parameters( [ "message", "tree", "parents" ], [ "author", "committer" ] ), __modifyAttributesForObjectsReferingRepo )
),
ExternalListOfObjects( "git/trees", "git_tree", GitTree,
ElementGetable( Parameters( [ "sha" ], [] ), __modifyAttributesForObjectsReferingRepo ),
ElementGetable( Parameters( [ "sha" ], [ "recursive" ] ), __modifyAttributesForObjectsReferingRepo ),
ElementCreatable( Parameters( [ "tree" ], [ "base_tree" ] ), __modifyAttributesForObjectsReferingRepo )
),
ExternalListOfObjects( "git/blobs", "git_blob", GitBlob,