Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2016-09-09 17:37:12 +0300
committerJunio C Hamano <gitster@pobox.com>2016-09-09 21:24:52 +0300
commitf74087f6ed21e65a926cb4facfa39d142eeffa96 (patch)
tree1a600ab5d91c6bb1190b147760193bf9067dc497 /sequencer.c
parentc527b55e74181291da9bf9d6ca4cd2f7133f934b (diff)
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>
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sequencer.c b/sequencer.c
index eb700913a1..96b9ae1978 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -464,7 +464,7 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)
* to work on.
*/
if (write_cache_as_tree(head, 0, NULL))
- die (_("Your index file is unmerged."));
+ return error(_("Your index file is unmerged."));
} else {
unborn = get_sha1("HEAD", head);
if (unborn)