(lines: list[str], newline: str)
| 108 | |
| 109 | |
| 110 | def _parse_create_diff(lines: list[str], newline: str) -> str: |
| 111 | parser = ParserState(lines=[*lines, END_PATCH]) |
| 112 | output: list[str] = [] |
| 113 | |
| 114 | while not _is_done(parser, SECTION_TERMINATORS): |
| 115 | if parser.index >= len(parser.lines): |
| 116 | break |
| 117 | line = parser.lines[parser.index] |
| 118 | parser.index += 1 |
| 119 | if not line.startswith("+"): |
| 120 | raise ValueError(f"Invalid Add File Line: {line}") |
| 121 | output.append(line[1:]) |
| 122 | |
| 123 | return newline.join(output) |
| 124 | |
| 125 | |
| 126 | def _parse_update_diff(lines: list[str], input: str) -> ParsedUpdateDiff: |
no test coverage detected