Closed mrnugget closed 3 years ago
cc @sofiia-tesliuk. I think @mrnugget will spend a little bit of time trying to fix this, but more than likely we will probably revert https://github.com/sourcegraph/go-diff/pull/53 and then re-introduce it once we can do it in a way that doesn't cause panics.
PR https://github.com/sourcegraph/go-diff/pull/53 introduced behaviour that tries to detect new file headers while parsing hunks.
The problem is that it breaks the parsing of diffs like these:
If we try to parse this we get a nil-panic:
The nil panic comes from a missing return here:
https://github.com/sourcegraph/go-diff/blob/96789e3401eadc2247f02d416dc90be9ccd98962/diff/parse.go#L60-L64
But the underlying cause is that we abort the parsing of the diff once we hit the
--
.