| 231 | } |
| 232 | |
| 233 | static int ce_compare_data(struct index_state *istate, |
| 234 | const struct cache_entry *ce, |
| 235 | struct stat *st) |
| 236 | { |
| 237 | int match = -1; |
| 238 | int fd = git_open_cloexec(ce->name, O_RDONLY); |
| 239 | |
| 240 | if (fd >= 0) { |
| 241 | struct object_id oid; |
| 242 | if (!index_fd(istate, &oid, fd, st, OBJ_BLOB, ce->name, 0)) |
| 243 | match = !oideq(&oid, &ce->oid); |
| 244 | /* index_fd() closed the file descriptor already */ |
| 245 | } |
| 246 | return match; |
| 247 | } |
| 248 | |
| 249 | static int ce_compare_link(const struct cache_entry *ce, size_t expected_size) |
| 250 | { |
no test coverage detected