(self, diff, commit)
| 89 | del self.func_commit[func_id] |
| 90 | |
| 91 | def on_rename(self, diff, commit): |
| 92 | # when similarity is 100%, diff.a_blob and diff.b_blob are None, so don't use them |
| 93 | new_fname = diff.rename_to |
| 94 | old_fname = diff.rename_from |
| 95 | last_commit = commit.parents[0] |
| 96 | sha = commit.hexsha |
| 97 | |
| 98 | if self.fname_filter(new_fname) or self.fname_filter(old_fname): |
| 99 | file_contents = get_contents(self.repo, last_commit, old_fname) |
| 100 | func_ids, func_ranges = self.func_extractor(file_contents, old_fname) |
| 101 | try: |
| 102 | modified_intervals = parse_patch(diff.diff.decode("utf-8")) |
| 103 | except UnicodeDecodeError: |
| 104 | print("UnicodeDecodeError Found in change_type {}".format(diff.change_type)) |
| 105 | return -1 |
| 106 | modified_func_ids = get_modified_func_ids(func_ranges, modified_intervals, func_ids) |
| 107 | for func_id in modified_func_ids: |
| 108 | if func_id in self.func_commit: |
| 109 | add_edge(self.G, sha, self.func_commit[func_id], func_id) |
| 110 | self.func_commit[func_id] = sha |
| 111 | |
| 112 | def on_modify(self, diff, commit): |
| 113 | assert diff.b_blob.path == diff.a_blob.path |
nothing calls this directly
no test coverage detected