Return a generator of all filepaths under path at commit.
(self, path, commit)
| 915 | raise Exception('Unexpected object type {0}'.format(o.type)) |
| 916 | |
| 917 | def get_paths(self, path, commit): |
| 918 | """Return a generator of all filepaths under path at commit.""" |
| 919 | _check_path_is_repo_relative(path) |
| 920 | |
| 921 | git_path = _get_git_path(path) |
| 922 | tree = self.gl_repo.git_repo[commit.tree[git_path].id] |
| 923 | assert tree.type == pygit2.GIT_OBJ_TREE |
| 924 | |
| 925 | for tree_entry in tree: |
| 926 | tree_entry_path = os.path.join(path, tree_entry.name) |
| 927 | if tree_entry.type == 'tree': |
| 928 | for fp in self.get_paths(tree_entry_path, commit): |
| 929 | yield fp |
| 930 | else: |
| 931 | yield tree_entry_path |
| 932 | |
| 933 | def diff_file(self, path): |
| 934 | """Diff the working version of path with its committed version.""" |
no test coverage detected