diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2018-03-12 03:27:38 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-03-14 17:23:48 +0100 |
commit | d61d87bd156a1d49b827d1b26f023fd70febfa06 (patch) | |
tree | dc70591686c1769f5146b0e0822aec366a1b8dfc /sha1_file.c | |
parent | builtin/index-pack: convert struct ref_delta_entry to object_id (diff) | |
download | git-d61d87bd156a1d49b827d1b26f023fd70febfa06.tar.xz git-d61d87bd156a1d49b827d1b26f023fd70febfa06.zip |
sha1_file: convert read_loose_object to use struct object_id
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1_file.c')
-rw-r--r-- | sha1_file.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sha1_file.c b/sha1_file.c index 6b887f8aaf..5081d585a2 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -2176,7 +2176,7 @@ static int check_stream_sha1(git_zstream *stream, } int read_loose_object(const char *path, - const unsigned char *expected_sha1, + const struct object_id *expected_oid, enum object_type *type, unsigned long *size, void **contents) @@ -2208,19 +2208,19 @@ int read_loose_object(const char *path, } if (*type == OBJ_BLOB) { - if (check_stream_sha1(&stream, hdr, *size, path, expected_sha1) < 0) + if (check_stream_sha1(&stream, hdr, *size, path, expected_oid->hash) < 0) goto out; } else { - *contents = unpack_sha1_rest(&stream, hdr, *size, expected_sha1); + *contents = unpack_sha1_rest(&stream, hdr, *size, expected_oid->hash); if (!*contents) { error("unable to unpack contents of %s", path); git_inflate_end(&stream); goto out; } - if (check_sha1_signature(expected_sha1, *contents, + if (check_sha1_signature(expected_oid->hash, *contents, *size, type_name(*type))) { error("sha1 mismatch for %s (expected %s)", path, - sha1_to_hex(expected_sha1)); + oid_to_hex(expected_oid)); free(*contents); goto out; } |