Re: [PATCH GSoC v18 11/13] cat-file: add remote-object-info to batch-command
From: Pablo Sabater <hidden>
Date: 2026-07-15 18:06:36
quoted
+static void parse_cmd_remote_object_info(struct batch_options *opt, + const char *line, struct strbuf *output, + struct expand_data *data) +{ + int count; + const char **argv; + char *line_to_split; + struct object_info *remote_object_info = NULL; + struct oid_array object_info_oids = OID_ARRAY_INIT; + + if (strlen(line) >= MAX_REMOTE_OBJ_INFO_LINE) + die(_("remote-object-info command too long")); + + line_to_split = xstrdup(line); + count = split_cmdline(line_to_split, &argv); + if (count < 0) + die(_("remote-object-info: %s"), split_cmdline_strerror(count)); + if (count - 1 > MAX_ALLOWED_OBJ_LIMIT) + die(_("remote-object-info supports at most %d objects"), + MAX_ALLOWED_OBJ_LIMIT); + + if (get_remote_info(opt, count, argv, &remote_object_info, + &object_info_oids)) + goto cleanup;Since this function does not return a value, the caller cannot even tell if there was an error if we just silently return like this. Is it really OK to silently ignore such a failure? Should we not die() loudly to report it instead?
True, this comes from the v11 before I got into, I think Eric tried to do something like what 'info' does (it doesn't die) prints "<oid> missing" but this comes from failing fetching. 'remote-object-info' prints "<oid> missing" when the fetching works but the oid is unrecognized. I will add a die instead of the goto. Thanks.
Thanks.
Regards, Pablo