range-diff: libify the read_patches() function again
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Thu, 4 Feb 2021 20:07:50 +0000 (20:07 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 5 Feb 2021 01:16:42 +0000 (17:16 -0800)
commita2d474adf32c4ea2585b2c6109c356523124e1f9
tree235cdad91c3331d1cc31a56116e411f7a0a1a6e3
parent8c29b497946fde2a6ef597d960a05d3dd36dcbf0
range-diff: libify the read_patches() function again

In library functions, we do want to avoid the (simple, but rather final)
`die()` calls, instead returning with a value indicating an error.

Let's do exactly that in the code introduced in b66885a30cb8
(range-diff: add section header instead of diff header, 2019-07-11) that
wants to error out if a diff header could not be parsed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
range-diff.c