(commit)
| 7 | |
| 8 | |
| 9 | def _diff_with_first_parent(commit): |
| 10 | if len(commit.parents) == 0: |
| 11 | prev_commit = EMPTY_TREE_SHA |
| 12 | else: |
| 13 | prev_commit = commit.parents[0] |
| 14 | # commit.diff automatically detect renames |
| 15 | return commit.diff(prev_commit, |
| 16 | create_patch=True, R=True, indent_heuristic=True) |
| 17 | |
| 18 | def diff_with_commit(current_commit:Commit, base_commit:Union[Commit, str]=None): |
| 19 | localBaseCommit = base_commit |