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>
Patryk Obara committed
Aug 20, 2017 at 22:09 UTC
bebfecb94c5c71091a07ebbd300740990d3266c7
1 file changed
+3
-3
read-cache.c
+3
-3
@@ -160,9 +160,9 @@ static int ce_compare_data(const struct cache_entry *ce, struct stat *st)
160
int fd = git_open_cloexec(ce->name, O_RDONLY);
161
162
if (fd >= 0) {
163
- unsigned char sha1[20];
164
- if (!index_fd(sha1, fd, st, OBJ_BLOB, ce->name, 0))
165
- match = hashcmp(sha1, ce->oid.hash);
163
+ struct object_id oid;
164
+ if (!index_fd(oid.hash, fd, st, OBJ_BLOB, ce->name, 0))
165
+ match = oidcmp(&oid, &ce->oid);
166
/* index_fd() closed the file descriptor already */
167
}
168
return match;