Skip to content

Commit bebfecb

Browse files
dreamergitster
authored andcommitted
read-cache: convert to struct object_id
Replace hashcmp with oidcmp. Signed-off-by: Patryk Obara <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent eab8bf2 commit bebfecb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

read-cache.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ static int ce_compare_data(const struct cache_entry *ce, struct stat *st)
160160
int fd = git_open_cloexec(ce->name, O_RDONLY);
161161

162162
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);
166166
/* index_fd() closed the file descriptor already */
167167
}
168168
return match;

0 commit comments

Comments
 (0)