summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2016-09-09 14:37:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-09-09 18:24:52 (GMT)
commitc3e8618c1f26f9b6b658d02a09530ae8eb85fc04 (patch)
tree92f89b52279512dba11fb02f173637d8d48332d4 /sequencer.c
parent34b0528b735cd22e5600576c10904dff262b8332 (diff)
downloadgit-c3e8618c1f26f9b6b658d02a09530ae8eb85fc04.zip
git-c3e8618c1f26f9b6b658d02a09530ae8eb85fc04.tar.gz
git-c3e8618c1f26f9b6b658d02a09530ae8eb85fc04.tar.bz2
sequencer: lib'ify prepare_revs()
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 prepare_revs(), walk_revs_populate_todo() was just taught to return errors, after verifying that its callers are 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 prepare_revs() callable from new callers that want it not to die, without changing the external behaviour of anything existing. 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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sequencer.c b/sequencer.c
index ab599e0..7fd0f99 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -623,7 +623,7 @@ leave:
return res;
}
-static void prepare_revs(struct replay_opts *opts)
+static int prepare_revs(struct replay_opts *opts)
{
/*
* picking (but not reverting) ranges (but not individual revisions)
@@ -633,10 +633,11 @@ static void prepare_revs(struct replay_opts *opts)
opts->revs->reverse ^= 1;
if (prepare_revision_walk(opts->revs))
- die(_("revision walk setup failed"));
+ return error(_("revision walk setup failed"));
if (!opts->revs->commits)
- die(_("empty commit set passed"));
+ return error(_("empty commit set passed"));
+ return 0;
}
static void read_and_refresh_cache(struct replay_opts *opts)