When listing branches with ref lookups, if one of the known raw refs
doesn't point to a commit then "git branch" would return error(),
terminating the whole for_each_rawref() iteration and possibly hiding
any remaining refs.
Signed-off-by: Simo Melenius <simo.melenius@iki.fi>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit = lookup_commit_reference_gently(sha1, 1);
if (!commit) {
cb->ret = error("branch '%s' does not point at a commit", refname);
- return cb->ret;
+ return 0;
}
/* Filter with with_commit if specified */
free_ref_list(&ref_list);
+ if (cb.ret)
+ error("some refs could not be read");
+
return cb.ret;
}