range-diff: simplify code spawning `git log`
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Thu, 4 Feb 2021 20:07:51 +0000 (20:07 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 5 Feb 2021 01:16:42 +0000 (17:16 -0800)
commit5189bb87249434fba3a82f17b2bc6c93025ba88d
tree1e40df6d4d8d2dbcb2bd040f92f9ace511be74c2
parenta2d474adf32c4ea2585b2c6109c356523124e1f9
range-diff: simplify code spawning `git log`

Previously, we waited for the child process to be finished in every
failing code path as well as at the end of the function
`show_range_diff()`.

However, we do not need to wait that long. Directly after reading the
output of the child process, we can wrap up the child process.

This also has the advantage that we don't do a bunch of unnecessary work
in case `finish_command()` returns with an error anyway.

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