]> granicus.if.org Git - git/commitdiff
Merge branch 'jt/fsck-code-cleanup'
authorJunio C Hamano <gitster@pobox.com>
Fri, 11 Aug 2017 20:26:59 +0000 (13:26 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 11 Aug 2017 20:27:00 +0000 (13:27 -0700)
Code clean-up.

* jt/fsck-code-cleanup:
  fsck: cleanup unused variable
  object: remove "used" field from struct object
  fsck: remove redundant parse_tree() invocation

1  2 
builtin/fsck.c

diff --cc builtin/fsck.c
index 0e5a18e843b6dab11bd952886f00da3804d10dc0,64542ac3dea48e3a92901319233aa3a1e0c4cb9a..a92f44818610784091f8aac5ea14612be59cd184
@@@ -735,15 -728,14 +728,14 @@@ int cmd_fsck(int argc, const char **arg
                }
        }
  
-       heads = 0;
        for (i = 0; i < argc; i++) {
                const char *arg = argv[i];
 -              unsigned char sha1[20];
 -              if (!get_sha1(arg, sha1)) {
 -                      struct object *obj = lookup_object(sha1);
 +              struct object_id oid;
 +              if (!get_oid(arg, &oid)) {
 +                      struct object *obj = lookup_object(oid.hash);
  
                        if (!obj || !(obj->flags & HAS_OBJ)) {
 -                              error("%s: object missing", sha1_to_hex(sha1));
 +                              error("%s: object missing", oid_to_hex(&oid));
                                errors_found |= ERROR_OBJECT;
                                continue;
                        }