MCPcopy Create free account
hub / github.com/danvk/webdiff / RawDiffLine

Class RawDiffLine

webdiff/unified_diff.py:150–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148# See https://git-scm.com/docs/git-diff#_raw_output_format
149@dataclass
150class RawDiffLine:
151 src_mode: str
152 """e.g. 100644; 000000 for creation/unmerged"""
153 dst_mode: str
154 src_sha: str
155 """sha1 or 0 if creation/unmerged"""
156 dst_sha: str
157 status: str
158 """A, C (copy), D, M, R, T (change in type), U (unmerged), X (bug)"""
159 path: str
160 score: Union[int, None] = None
161 """Only for R or C"""
162 dst_path: Union[str, None] = None
163 """Only set when status=C or R."""
164 num_add: Union[int, None] = None
165 """Num added lines from diffstat. None for binary files."""
166 num_delete: Union[int, None] = None
167 """Num removed lines from diffstat. None for binary files."""
168
169
170def parse_raw_diff_line(parts: list[str]) -> RawDiffLine:

Callers 3

test_parse_raw_diff_manyFunction · 0.90
parse_raw_diff_lineFunction · 0.85

Calls

no outgoing calls

Tested by 2

test_parse_raw_diff_manyFunction · 0.72