From: Junio C Hamano Date: Mon, 25 May 2020 02:39:39 +0000 (-0700) Subject: Merge branch 'ds/multi-pack-verify' X-Git-Tag: v2.27.0-rc2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d55a4ae71d515e788e5afb355a20c4b262049cac;p=thirdparty%2Fgit.git Merge branch 'ds/multi-pack-verify' Fix for a copy-and-paste error introduced during 2.20 era. * ds/multi-pack-verify: fsck: use ERROR_MULTI_PACK_INDEX --- d55a4ae71d515e788e5afb355a20c4b262049cac diff --cc builtin/fsck.c index 8d13794b14,b1447c2610..f02cbdb439 --- a/builtin/fsck.c +++ b/builtin/fsck.c @@@ -49,14 -49,23 +49,15 @@@ static int name_objects #define ERROR_PACK 04 #define ERROR_REFS 010 #define ERROR_COMMIT_GRAPH 020 + #define ERROR_MULTI_PACK_INDEX 040 -static const char *describe_object(struct object *obj) +static const char *describe_object(const struct object_id *oid) { - static struct strbuf buf = STRBUF_INIT; - char *name = name_objects ? - lookup_decoration(fsck_walk_options.object_names, obj) : NULL; - - strbuf_reset(&buf); - strbuf_addstr(&buf, oid_to_hex(&obj->oid)); - if (name) - strbuf_addf(&buf, " (%s)", name); - - return buf.buf; + return fsck_describe_object(&fsck_walk_options, oid); } -static const char *printable_type(struct object *obj) +static const char *printable_type(const struct object_id *oid, + enum object_type type) { const char *ret; @@@ -944,15 -853,17 +945,15 @@@ int cmd_fsck(int argc, const char **arg struct child_process midx_verify = CHILD_PROCESS_INIT; const char *midx_argv[] = { "multi-pack-index", "verify", NULL, NULL, NULL }; - midx_verify.argv = midx_argv; - midx_verify.git_cmd = 1; - if (run_command(&midx_verify)) - errors_found |= ERROR_COMMIT_GRAPH; - prepare_alt_odb(the_repository); - for (alt = the_repository->objects->alt_odb_list; alt; alt = alt->next) { + for (odb = the_repository->objects->odb; odb; odb = odb->next) { + child_process_init(&midx_verify); + midx_verify.argv = midx_argv; + midx_verify.git_cmd = 1; midx_argv[2] = "--object-dir"; - midx_argv[3] = alt->path; + midx_argv[3] = odb->path; if (run_command(&midx_verify)) - errors_found |= ERROR_COMMIT_GRAPH; + errors_found |= ERROR_MULTI_PACK_INDEX; } }