From: Junio C Hamano Date: Fri, 11 Aug 2017 20:26:59 +0000 (-0700) Subject: Merge branch 'jt/fsck-code-cleanup' X-Git-Tag: v2.15.0-rc0~203 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2c40c6a77faaee1bfabe95d58371341142f62635;p=git Merge branch 'jt/fsck-code-cleanup' Code clean-up. * jt/fsck-code-cleanup: fsck: cleanup unused variable object: remove "used" field from struct object fsck: remove redundant parse_tree() invocation --- 2c40c6a77faaee1bfabe95d58371341142f62635 diff --cc builtin/fsck.c index 0e5a18e843,64542ac3de..a92f448186 --- a/builtin/fsck.c +++ b/builtin/fsck.c @@@ -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; }