]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ds/multi-pack-verify'
authorJunio C Hamano <gitster@pobox.com>
Mon, 25 May 2020 02:39:39 +0000 (19:39 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 25 May 2020 02:39:39 +0000 (19:39 -0700)
Fix for a copy-and-paste error introduced during 2.20 era.

* ds/multi-pack-verify:
  fsck: use ERROR_MULTI_PACK_INDEX

1  2 
builtin/fsck.c

diff --cc builtin/fsck.c
index 8d13794b1412c82f3a19331548b4b2cb26da349b,b1447c261020a957fd048a2ed4b9e6b1656721e3..f02cbdb439b210f973c06588da8a29f87fe23350
@@@ -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;
                }
        }