Skip to content

Two regexes in parsePatch disagree about when a line with prefix diff is a patch header #648

@ExplodingCabbage

Description

@ExplodingCabbage

Namely, this regex...

/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/

... and this regex:

/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/

In the former, diff bla matches; in the latter, it does not. This surely has some buggy or at least weird-and-arbitrary consequences.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions