read-cache: convert to struct object_id

Replace hashcmp with oidcmp.

Signed-off-by: Patryk Obara <patryk.obara@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patryk Obara 2017-08-20 22:09:27 +02:00 committed by Junio C Hamano
parent eab8bf292b
commit bebfecb94c

View file

@ -160,9 +160,9 @@ static int ce_compare_data(const struct cache_entry *ce, struct stat *st)
int fd = git_open_cloexec(ce->name, O_RDONLY); int fd = git_open_cloexec(ce->name, O_RDONLY);
if (fd >= 0) { if (fd >= 0) {
unsigned char sha1[20]; struct object_id oid;
if (!index_fd(sha1, fd, st, OBJ_BLOB, ce->name, 0)) if (!index_fd(oid.hash, fd, st, OBJ_BLOB, ce->name, 0))
match = hashcmp(sha1, ce->oid.hash); match = oidcmp(&oid, &ce->oid);
/* index_fd() closed the file descriptor already */ /* index_fd() closed the file descriptor already */
} }
return match; return match;