Collect ``+``-prefixed lines for an Add File hunk.
(
lines: List[str], start_idx: int,
)
| 565 | return None |
| 566 | |
| 567 | def _parse_add_file_content( |
| 568 | lines: List[str], start_idx: int, |
| 569 | ) -> Tuple[str, int]: |
| 570 | """Collect ``+``-prefixed lines for an Add File hunk.""" |
| 571 | content_lines: List[str] = [] |
| 572 | i = start_idx |
| 573 | while i < len(lines) and not lines[i].startswith("***"): |
| 574 | if lines[i].startswith("+"): |
| 575 | content_lines.append(lines[i][1:]) |
| 576 | i += 1 |
| 577 | content = "\n".join(content_lines) |
| 578 | if content.endswith("\n"): |
| 579 | content = content[:-1] |
| 580 | return content, i |
| 581 | |
| 582 | def _parse_update_chunks( |
| 583 | lines: List[str], start_idx: int, |