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
+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,