| |
@@ -120,7 +120,13 @@
|
| |
# Not tested and no idea how to test it, but better safe than sorry
|
| |
flask.abort(404, description="File not found")
|
| |
|
| |
- if isinstance(blob_or_tree, pygit2.TreeEntry): # Returned a file
|
| |
+ is_file = False
|
| |
+ try:
|
| |
+ is_file = isinstance(blob_or_tree, pygit2.TreeEntry)
|
| |
+ except AttributeError:
|
| |
+ is_file = isinstance(blob_or_tree, pygit2.Blob)
|
| |
+
|
| |
+ if is_file:
|
| |
filename = blob_or_tree.name
|
| |
name, ext = os.path.splitext(filename)
|
| |
blob_obj = repo_obj[blob_or_tree.oid]
|
| |
pygit2 has some breaking changes on 1.0.0 release 0, modify our doc server to support both old and new pygit2 versions