summaryrefslogtreecommitdiff
path: root/builtin/fsck.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-08-11 13:26:55 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-08-11 13:26:55 -0700
commitdf422678a800ffb1db8f3f146e2786f1cbf0059b (patch)
tree893f5099c5d03859d6e21c1b7eb4f501462b9431 /builtin/fsck.c
parentMerge branch 'sb/object-id' (diff)
parentsha1_name: convert uses of 40 to GIT_SHA1_HEXSZ (diff)
downloadtgif-df422678a800ffb1db8f3f146e2786f1cbf0059b.tar.xz
Merge branch 'bc/object-id'
Conversion from uchar[20] to struct object_id continues. * bc/object-id: sha1_name: convert uses of 40 to GIT_SHA1_HEXSZ sha1_name: convert GET_SHA1* flags to GET_OID* sha1_name: convert get_sha1* to get_oid* Convert remaining callers of get_sha1 to get_oid. builtin/unpack-file: convert to struct object_id bisect: convert bisect_checkout to struct object_id builtin/update_ref: convert to struct object_id sequencer: convert to struct object_id remote: convert struct push_cas to struct object_id submodule: convert submodule config lookup to use object_id builtin/merge-tree: convert remaining caller of get_sha1 to object_id builtin/fsck: convert remaining caller of get_sha1 to object_id
Diffstat (limited to 'builtin/fsck.c')
-rw-r--r--builtin/fsck.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/fsck.c b/builtin/fsck.c
index 99dea7adf6..0e5a18e843 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -738,12 +738,12 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
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;
}