MCPcopy Create free account
hub / github.com/Persper/code-analytics / _diff_with_first_parent

Function _diff_with_first_parent

persper/analytics/git_tools.py:9–16  ·  view source on GitHub ↗
(commit)

Source from the content-addressed store, hash-verified

7
8
9def _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
18def diff_with_commit(current_commit:Commit, base_commit:Union[Commit, str]=None):
19 localBaseCommit = base_commit

Callers 1

_analyze_commitMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected