]> git.ipfire.org Git - thirdparty/git.git/commit - sequencer.c
sequencer: lib'ify read_populate_opts()
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 9 Sep 2016 14:37:27 +0000 (16:37 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 9 Sep 2016 18:24:52 +0000 (11:24 -0700)
commit0d00da7bb3780c29e3d42ee255e0a09de8c43587
tree372f4687537d115bc5b14af0ee269365b790d37f
parent0ae42a038da1f63a5b090b70502087817cc54f5d
sequencer: lib'ify read_populate_opts()

Instead of dying there, let the caller high up in the callchain notice
the error and handle it (by dying, still).

The only caller of read_populate_opts(), sequencer_continue() can
already return errors, so its caller must be already prepared to
handle error returns, and with this step, we make it notice an error
return from this function.

So this is a safe conversion to make read_populate_opts() callable
from new callers that want it not to die, without changing the
external behaviour of anything existing.

Note that the function git_config_from_file(), called from
read_populate_opts(), can currently still die() (in git_parse_source(),
because the do_config_from_file() function sets die_on_error = 1). We do
not try to fix that here, as it would have larger ramifications on the
config code, and we also assume that we write the opts file
programmatically, hence any parse errors would be bugs.

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