diff options
Diffstat (limited to 'docs/gl_objects')
-rw-r--r-- | docs/gl_objects/projects.py | 5 | ||||
-rw-r--r-- | docs/gl_objects/projects.rst | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/docs/gl_objects/projects.py b/docs/gl_objects/projects.py index 6cdd260..4a6f3ad 100644 --- a/docs/gl_objects/projects.py +++ b/docs/gl_objects/projects.py @@ -142,7 +142,10 @@ items = project.repository_tree(path='docs', ref='branch1') # end repository tree # repository blob -file_content = p.repository_blob('master', 'README.rst') +items = project.repository_tree(path='docs', ref='branch1') +file_info = p.repository_blob(items[0]['id']) +content = base64.b64decode(file_info['content']) +size = file_info['size'] # end repository blob # repository raw_blob diff --git a/docs/gl_objects/projects.rst b/docs/gl_objects/projects.rst index 8465eb9..eb15a3b 100644 --- a/docs/gl_objects/projects.rst +++ b/docs/gl_objects/projects.rst @@ -120,7 +120,7 @@ List the repository tree: :start-after: # repository tree :end-before: # end repository tree -Get the content of a file for a commit: +Get the content and metadata of a file for a commit, using a blob sha: .. literalinclude:: projects.py :start-after: # repository blob |