Commit 81c3ce3c authored by Stefan Beller's avatar Stefan Beller Committed by Junio C Hamano

prepare_revision_walk(): check for return value in all places

Even the documentation tells us:

	You should check if it returns any error (non-zero return
	code) and if it does not, you can start using get_revision()
	to do the iteration.

In preparation for this commit, I grepped all occurrences of
prepare_revision_walk and added error messages, when there were none.
Signed-off-by: default avatarStefan Beller <>
Signed-off-by: default avatarJunio C Hamano <>
parent 32f56600
......@@ -653,7 +653,9 @@ static int print_ref_list(int kinds, int detached, int verbose, int abbrev, stru
(struct object *) filter, ""); = 1;
if (prepare_revision_walk(&ref_list.revs))
die(_("revision walk setup failed"));
if (verbose)
ref_list.maxwidth = calc_maxwidth(&ref_list);
......@@ -989,7 +989,8 @@ static const char *find_author_by_nickname(const char *name)
revs.mailmap = &mailmap;
read_mailmap(revs.mailmap, NULL);
if (prepare_revision_walk(&revs))
die(_("revision walk setup failed"));
commit = get_revision(&revs);
if (commit) {
struct pretty_print_context ctx = {0};
......@@ -1898,7 +1898,8 @@ int stat_tracking_info(struct branch *branch, int *num_ours, int *num_theirs)
init_revisions(&revs, NULL);
setup_revisions(rev_argc, rev_argv, &revs, NULL);
if (prepare_revision_walk(&revs))
die("revision walk setup failed");
/* ... and count the commits on each side. */
*num_ours = 0;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment