def _get_files_tree_api(repo_api, sha):
"""Get repo file paths using GitHub Tree API.
"""
files = []
# https://github.com/sigmavirus24/github3.py/issues/656
tree = repo_api.tree('%s?recursive=1' % sha).to_json()
if tree['truncated']:
return None
for item in tree['tree']:
if item['type'] == 'blob':
files.append(item['path'])
return files
评论列表
文章目录