sequencer: lib'ify do_pick_commit()

Instead of dying there, let the caller high up in the callchain notice the error and handle it (by dying, still). The only two callers of do_pick_commit(), pick_commits() and single_pick() already check the return value and pass it on to their callers, so their callers 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 do_pick_commit() callable from new callers that want it not to die, without changing the external behaviour of anything existing. While at it, remove the superfluous space. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Sep 9, 2016 at 16:37 UTC f74087f6ed21e65a926cb4facfa39d142eeffa96
1 file changed +1 -1
sequencer.c
+1 -1
@@ -464,7 +464,7 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)
464 * to work on.
465 */
466 if (write_cache_as_tree(head, 0, NULL))
467 - die (_("Your index file is unmerged."));
467 + return error(_("Your index file is unmerged."));
468 } else {
469 unborn = get_sha1("HEAD", head);
470 if (unborn)